Skip to content

fix(uploader): sync ingress with publicDomainTemplate via server-side apply#2527

Open
fl64 wants to merge 1 commit into
mainfrom
fix/uploader-ingress-public-domain-sync
Open

fix(uploader): sync ingress with publicDomainTemplate via server-side apply#2527
fl64 wants to merge 1 commit into
mainfrom
fix/uploader-ingress-public-domain-sync

Conversation

@fl64

@fl64 fl64 commented Jun 23, 2026

Copy link
Copy Markdown
Member

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 existing VirtualImage (or VirtualDisk / ClusterVirtualImage via dataSource.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 when dataSource.type=Upload) was created once and never reconciled. When an administrator changes publicDomainTemplate, the controller restarts with the new UPLOADER_INGRESS_HOST, but already-existing upload Ingresses keep their original host. As a result, users see a stale upload URL in VirtualImage.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-url annotation follow the current publicDomainTemplate.

What is the expected result?

  1. Create a VirtualImage with dataSource.type=Upload — the upload URL and Ingress host match the current publicDomainTemplate.
  2. Change publicDomainTemplate and wait for the controller to restart with the new UPLOADER_INGRESS_HOST.
  3. Trigger reconcile of the VirtualImage (e.g. annotate it).
  4. The upload URL shown to the user now reflects the new domain; uploading to the existing image works again.

Checklist

  • The code is covered by unit tests.
  • e2e tests passed.
  • Documentation updated according to the changes.
  • Changes were tested in the Kubernetes cluster manually.

Changelog entries

section: images
type: fix
summary: "Upload Ingress now follows publicDomainTemplate changes instead of keeping the host it was created with."

… 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>
@fl64 fl64 added this to the v1.10.0 milestone Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant