Skip to content

fix(policy): set observedGeneration in status conditions - #15490

Open
agrawalx wants to merge 1 commit into
linkerd:mainfrom
agrawalx:fix/issue-14964
Open

fix(policy): set observedGeneration in status conditions#15490
agrawalx wants to merge 1 commit into
linkerd:mainfrom
agrawalx:fix/issue-14964

Conversation

@agrawalx

Copy link
Copy Markdown

Set observedGeneration in status conditions

Fixes #14964
Supersedes #14973

Problem

The policy status controller writes status conditions with observedGeneration unset. The Gateway API specification requires implementations to set this field to the resource's metadata.generation when generating status:

Consumers use the field to detect stale status. In particular, Flagger v1.42+ checks condition.observedGeneration < metadata.generation after each route edit to confirm Linkerd has reconciled it. Since Linkerd never sets the field,
the check never passes and canary rollouts stall indefinitely:

HTTPRoute echo-blue.tools parent echo-blue is not ready
(status: True, observed generation: 0, current generation: 1)

Solution

  • Track metadata.generation on RouteRef, HttpLocalRateLimitPolicyRef, and EgressNetworkRef; populate it in every apply(). Storing it on the refs (rather than passing it down from apply only) keeps the periodic reconcile path consistent with the watch path.
  • Thread the generation through all condition-producing functions (accepted, no_matching_parent, resolved_refs, etc.) so every condition the controller writes carries observedGeneration.
  • Add the missing observedGeneration property (standard metav1.Condition shape, mirroring the existing httproute.policy.linkerd.io schema) to the EgressNetwork and HTTPLocalRateLimitPolicy CRD condition schemas.

Validation

  • New unit tests (policy-controller/k8s/status/src/tests/):
    • conditions carry the resource's generation for routes, rate-limit policies, and egress networks;
    • a generation bump with an unchanged spec produces a fresh patch carrying the new generation (the signal Flagger consumes), while a re-apply whose status already matches produces no patch (no self-trigger loop).

@agrawalx
agrawalx requested a review from a team as a code owner July 18, 2026 13:26
Signed-off-by: yash <yasha4658@gmail.com>
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.

Linkerd2 not setting observerdGeneration on HTTPRoute when using it for canary rollouts

1 participant