Skip to content

[Backport release-1.5] fix(backupstrategy-controller): repair lookup-gated backup objects - #3880

Closed
github-actions[bot] wants to merge 1 commit into
release-1.5from
backport-3524-to-release-1.5
Closed

github-actions[bot] wants to merge 1 commit into
release-1.5from
backport-3524-to-release-1.5

Conversation

@github-actions

Copy link
Copy Markdown

Description

Backport of #3524 to release-1.5.

@github-actions

Copy link
Copy Markdown
Author

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin backport-3524-to-release-1.5
git worktree add --checkout .worktree/backport-3524-to-release-1.5 backport-3524-to-release-1.5
cd .worktree/backport-3524-to-release-1.5
git reset --hard HEAD^
git cherry-pick -x 51ad22670684b7bc3b7b13bb54403e1aecedc997 e85501e9f5d3dc6effe5e8721b5db073af59bdb4 aa3accd12800fd977678d771c719e89fd064ff5c bf152ba8640da08fd77f486eaa7c4714c6ba6a9d 8b006391c2ba89280096dcee8fd7f85dd3a41c7d f859b710a45d7df4bd255991ab1d980b048d352a
git push --force-with-lease

The default Strategy CRs and the Velero BackupStorageLocation are
templated behind a `lookup` of the BucketClaim the same chart creates,
because the COSI driver assigns the real S3 bucket name
(`bucket-<claim-UID>`) and it cannot be computed at render time. On a
fresh install that lookup is empty, so those templates render nothing.

helm-controller does not re-render a release that succeeded and whose
chart and values did not change, and drift detection is off on
operator-generated HelmReleases, so the skip is permanent: a cluster
that loses the install-time race keeps `BackupClass cozy-default` with
no Strategy CRs and no Velero BSL indefinitely.

Add a DefaultObjectsGate runnable that, once the bucket name is
resolvable from the credentials projector's source Secret, verifies
that every object the BackupClass routes to exists and stamps both
reconcile.fluxcd.io/forceAt and reconcile.fluxcd.io/requestedAt on the
HelmRelease to force the real Helm upgrade that re-runs the lookups.
requestedAt alone is a no-op for an unchanged release, so both
annotations are required. Two Prometheus metrics expose the state
independently of the HelmRelease Ready condition.

Also make the per-user bucket credentials template fail loudly instead
of silently skipping when the source Secret is absent, so this class of
race surfaces as a failed release rather than as a missing Secret.

Backport of #3524 to release-1.5. The conflict in
docs/operations/backup-classes.md was resolved to the post-fix wording:
the pre-fix text claimed Flux repairs the skip on its interval
reconcile and told operators to run `flux reconcile helmrelease`, which
is precisely the misconception this change corrects.

Signed-off-by: Mattia Eleuteri <[email protected]>
Signed-off-by: Myasnikov Daniil <[email protected]>
@myasnikovdaniil
myasnikovdaniil force-pushed the backport-3524-to-release-1.5 branch from 5b4e44f to 465a1b8 Compare August 17, 2026 15:29
@github-actions github-actions Bot added the size/XXL This PR changes 1000+ lines, ignoring generated files label Aug 17, 2026
@myasnikovdaniil
myasnikovdaniil marked this pull request as ready for review August 17, 2026 16:28
@github-actions github-actions Bot added area/release Issues or PRs related to release tooling (changelog, backport, release pipeline) kind/bug Categorizes issue or PR as related to a bug labels Aug 18, 2026
@androndo

Copy link
Copy Markdown
Contributor

Closing: v1.5.4 is the final release of the 1.5 line (see the v1.5.4 release notes), so there is no further 1.5.x release for this backport to ship in. The fix is on main via #3524 and on release-1.6 via #3731.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/release Issues or PRs related to release tooling (changelog, backport, release pipeline) kind/bug Categorizes issue or PR as related to a bug size/XXL This PR changes 1000+ lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants