Repository navigation
helm-operator: record observedGeneration in the custom resource status - #7153
Open
TarasLykhenko wants to merge 1 commit into
Open
TarasLykhenko wants to merge 1 commit into
TarasLykhenko wants to merge 1 commit into
Conversation
TarasLykhenko
force-pushed
the
helm-observed-generation
branch
3 times, most recently
from
November 12, 2026 14:55
7001cd2 to
f2e3e32
Compare
TarasLykhenko
marked this pull request as ready for review
November 12, 2026 14:55
The Helm operator now sets status.observedGeneration to the custom resource's metadata.generation on every status write, so clients can tell whether the conditions and deployedRelease describe the current spec or an earlier one. The generation is set before any condition changes, so failure paths record it too, and a spec change that needs no release upgrade still produces a status write. Signed-off-by: TarasLykhenko <18290033+TarasLykhenko@users.noreply.github.com>
TarasLykhenko
force-pushed
the
helm-observed-generation
branch
from
November 12, 2026 14:57
f2e3e32 to
58fc4df
Compare
This branch has not been deployed
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 of the change:
The Helm operator now sets
status.observedGenerationto the custom resource'smetadata.generationon every status write, following the Kubernetes API conventions.The generation is set right after the status is read and before any condition changes. So:
ReleaseFailedandIrreconcilablefailure paths) records the generation it describes;observedGeneration. Before this change,reflect.DeepEqual(status, originalStatus)skipped that write.The field is additive and
omitempty.Motivation for the change:
Today the status holds only
conditionsanddeployedRelease, so a client can't tell whetherDeployed=Truedescribes the current spec or an earlier one. After a spec update, the previousDeployed=Truestays until the operator reconciles the change. If the operator is down or stuck, it stays indefinitely. A client that waits onDeployed=Truebefore acting, for example a controller that installs a chart through a Helm-based operator, reports ready for a spec that was never applied.With
observedGeneration, a client treats the status as current only whenstatus.observedGeneration == metadata.generation.The same request is open against helm-operator-plugins: operator-framework/helm-operator-plugins#577.
Testing:
TestReconcileSetsObservedGenerationininternal/helm/controller/reconcile_test.gorunsReconcilewith a fake client and a fake release manager for install, upgrade, a spec change with no release change, and aSyncfailure. Each case checks that the stored status hasobservedGenerationequal to the resource's generation. All four fail without the change.Checklist