Skip to content

Recover from drifted Ready/Released status conditions - #1580

Merged
matheuscscp merged 1 commit into
fluxcd:mainfrom
peterbuecker-form3:fix-1409-insync-status-drift
Sep 2, 2026
Merged

Recover from drifted Ready/Released status conditions#1580
matheuscscp merged 1 commit into
fluxcd:mainfrom
peterbuecker-form3:fix-1409-insync-status-drift

Conversation

@peterbuecker-form3

@peterbuecker-form3 peterbuecker-form3 commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Description

When a post-action status condition patch failed for a HelmRelease that was just installed or upgraded (e.g. due to version conflicts), but history was successfully persisted, a HelmRelease could be stranded with Ready=Unknown while actually being completely installed in the cluster.

Subsequent reconciliations of the HelmRelease would not correct that drift as the pre-existing correction mechanism required a Released status condition to exist. However, since that would've been created in the same patch as the missing Ready update, that would always fail.

This fix extends the existing correction mechanism to allow for a missing Released status condition, in which case it will resort to status.lastAttemptedReleaseAction or status.history to determine the desired state for Ready and Released.

Fixes: #1409

Proof of work

The PR was tested against the reproduction case shared in #1409 (comment). The patch was successful in correct the drifted Ready and Released status conditions. The existing table tests for similar scenarios were extended with new test cases covering the specific situation addressed here.

When a post-action status condition patch failed for a HelmRelease
that was just installed or upgraded (e.g. due to version conflicts),
but history was successfully persisted, a HelmRelease could be
stranded with `Ready=Unknown` while actually being completely
installed in the cluster.

Subsequent reconciliations of the HelmRelease would not correct
that drift as the pre-existing correction mechanism required
a `Released` status condition to exist. However, since that
would've been created in the same patch as the missing `Ready`
update, that would always fail.

This fix extends the existing correction mechanism to allow
for a missing `Released` status condition, in which case it will
resort to `status.lastAttemptedReleaseAction` or `status.history`
to determine the desired state for `Ready` and `Released`.

Signed-off-by: Peter Bücker <peter.buecker@form3.tech>
Assisted-by: cursor/grok-4.6

@matheuscscp matheuscscp left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks @peterbuecker-form3

@matheuscscp matheuscscp added bug Something isn't working backport:release/v1.6.x To be backported to release/v1.6.x labels Sep 2, 2026
@matheuscscp
matheuscscp merged commit 747dfc0 into fluxcd:main Sep 2, 2026
8 checks passed
@fluxcdbot

Copy link
Copy Markdown
Member

Successfully created backport PR for release/v1.6.x:

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

Labels

backport:release/v1.6.x To be backported to release/v1.6.x bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HelmRelease installation stuck with Ready=Unknownwhile being perfectly installed

3 participants