fix(policy): set observedGeneration in status conditions - #15490
Open
agrawalx wants to merge 1 commit into
Open
Conversation
Signed-off-by: yash <yasha4658@gmail.com>
agrawalx
force-pushed
the
fix/issue-14964
branch
from
July 18, 2026 13:27
3fc088a to
1c7d00d
Compare
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.
Set
observedGenerationin status conditionsFixes #14964
Supersedes #14973
Problem
The policy status controller writes status conditions with
observedGenerationunset. The Gateway API specification requires implementations to set this field to the resource'smetadata.generationwhen generating status:Consumers use the field to detect stale status. In particular, Flagger v1.42+ checks
condition.observedGeneration < metadata.generationafter each route edit to confirm Linkerd has reconciled it. Since Linkerd never sets the field,the check never passes and canary rollouts stall indefinitely:
Solution
metadata.generationonRouteRef,HttpLocalRateLimitPolicyRef, andEgressNetworkRef; populate it in everyapply(). Storing it on the refs (rather than passing it down fromapplyonly) keeps the periodic reconcile path consistent with the watch path.accepted,no_matching_parent,resolved_refs, etc.) so every condition the controller writes carriesobservedGeneration.observedGenerationproperty (standardmetav1.Conditionshape, mirroring the existinghttproute.policy.linkerd.ioschema) to theEgressNetworkandHTTPLocalRateLimitPolicyCRD condition schemas.Validation
policy-controller/k8s/status/src/tests/):