fix(uploader): sync ingress with publicDomainTemplate via server-side apply#2527
Open
fl64 wants to merge 1 commit into
Open
fix(uploader): sync ingress with publicDomainTemplate via server-side apply#2527fl64 wants to merge 1 commit into
fl64 wants to merge 1 commit into
Conversation
… apply Uploader Ingress was created once with client.Create and never updated on AlreadyExists, so changing publicDomainTemplate left existing upload Ingresses with a stale host in spec.rules[].host, spec.tls[].hosts and the AnnUploadURL annotation shown to users. Replace Create with server-side apply (client.Patch + client.Apply) so the Ingress is reconciled on every upload-flow reconcile: created when absent, patched when spec/annotations drift. Field ownership is stable across controller restarts. Signed-off-by: Pavel Tishkov <pavel.tishkov@flant.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
After changing
publicDomainTemplate, existing image upload endpoints stop matching the cluster ingress: the upload URL shown to the user keeps the old domain, so uploading data to an existingVirtualImage(orVirtualDisk/ClusterVirtualImageviadataSource.type=Upload) fails or points at the wrong host.Why do we need it, and what problem does it solve?
The upload Ingress for
VirtualImage/ClusterVirtualImage/VirtualDisk(created whendataSource.type=Upload) was created once and never reconciled. When an administrator changespublicDomainTemplate, the controller restarts with the newUPLOADER_INGRESS_HOST, but already-existing upload Ingresses keep their original host. As a result, users see a stale upload URL inVirtualImage.status/ events and the upload flow for already-created images is broken after a domain change.The Ingress is now reconciled on every upload-flow reconcile via server-side apply, so its host, TLS hosts, and the
upload-urlannotation follow the currentpublicDomainTemplate.What is the expected result?
VirtualImagewithdataSource.type=Upload— the upload URL and Ingress host match the currentpublicDomainTemplate.publicDomainTemplateand wait for the controller to restart with the newUPLOADER_INGRESS_HOST.VirtualImage(e.g. annotate it).Checklist
Changelog entries