Skip to content

test(conformance): preserve foreign status entries on BackendTLSPolicy and Gateway - #5206

Open
lexfrei wants to merge 4 commits into
kubernetes-sigs:mainfrom
lexfrei:conformance/preserve-foreign-status-policy
Open

test(conformance): preserve foreign status entries on BackendTLSPolicy and Gateway#5206
lexfrei wants to merge 4 commits into
kubernetes-sigs:mainfrom
lexfrei:conformance/preserve-foreign-status-policy

Conversation

@lexfrei

@lexfrei lexfrei commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this?

/kind test

/area conformance-test

What this PR does / why we need it:

Two more tests for the cross-controller status contract, stacked on #5138 (the first commit here is that PR, the last three are new).

BackendTLSPolicy status.ancestors is the only other status list scoped by controllerName, so its test is a structural copy of the HTTPRoute one: seed an ancestor entry under a stale controllerName, bump the generation, wait for the implementation's own ancestor to catch up, require the seeded entry to survive byte for byte.

Gateway and Listener conditions carry no controllerName. The API scopes them by condition type instead ("Implementations MUST NOT remove or reorder Conditions that they are not directly responsible for"), so that test seeds a condition of a foreign type on the Gateway and on one listener and checks survival the same way.

The status helpers needed the same observedGeneration exemption RouteMustHaveParents already has: nothing reconciles a seeded entry, so it never catches up. Unit tests pin both exemptions. The two new tests pass against a live implementation: cloudflare-tunnel-gateway-controller on kind with a real Cloudflare Tunnel.

Which issue(s) this PR fixes:

Part of #5105

Does this PR introduce a user-facing change?:

NONE

AI disclosure

This PR was prepared with AIL:3. I personally reviewed each line of the submission prior to opening this PR.

…ollers

RouteStatus.Parents is namespaced by (parentRef, controllerName), and an
implementation MUST NOT update entries whose controllerName is not its own.
Nothing in the suite checked that, and the harness could not have hosted
such a check: RouteMustHaveParents required every entry in status.parents
to carry the Route's current generation, so a stale entry left behind by a
second controller stalled the wait until it timed out.

Add a StaleControllerName sentinel that tests can put on a parent status
entry to stand in for another implementation, and skip those entries in the
observedGeneration check. Nothing reconciles them, so they cannot be
expected to keep up with the Route's generation. On top of that, add a test
that seeds such an entry, bumps the Route's generation to force a status
write, and checks that the seeded entry comes back byte for byte alongside
the implementation's own entry.

The observedGeneration check also ran against the parent list read on the
previous poll rather than the one just fetched. On the first iteration that
list was still empty, so a Route whose status already matched satisfied the
wait without the check running at all. It now runs on the snapshot it just
read, which tightens every RouteMustHaveParents caller in the suite: a
status that matches but has not caught up with the Route generation no
longer ends the wait early. The check moves into staleParentStatus so both
halves of it can be pinned directly.

Signed-off-by: Aleksei Sviridkin <f@lex.la>
@kubernetes-prow kubernetes-prow Bot added release-note-none Denotes a PR that doesn't merit a release note. kind/test area/conformance-test Issues or PRs related to Conformance tests. labels Aug 30, 2026
@kubernetes-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: lexfrei
Once this PR has been reviewed and has the lgtm label, please assign mikemorris for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubernetes-prow kubernetes-prow Bot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Aug 30, 2026
@kubernetes-prow
kubernetes-prow Bot requested review from candita and kflynn August 30, 2026 21:05
@kubernetes-prow kubernetes-prow Bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Aug 30, 2026
@kubernetes-prow

Copy link
Copy Markdown

Hi @lexfrei. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Tip

We noticed you've done this a few times! Consider joining the org to skip this step and gain /lgtm and other bot rights. We recommend asking approvers on your previous PRs to sponsor you.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@lexfrei

lexfrei commented Aug 30, 2026

Copy link
Copy Markdown
Contributor Author

Ran the two new tests against a live implementation, my cloudflare-tunnel-gateway-controller on kind with a real Cloudflare Tunnel. Both pass; dropped the "not run yet" line from the description.

@bittrance

Copy link
Copy Markdown

I ran the tests against cloud-provider-kind, which turned out to need a fix: kubernetes-sigs/cloud-provider-kind#471.

bittrance added a commit to bittrance/cloud-provider-kind that referenced this pull request Aug 31, 2026
This satisfies upcoming conformance tests in kubernetes-sigs/gateway-api#5206 .

Signed-off-by: Bittrance <bittrance@gmail.com>
@aojea

aojea commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

I do not know who is reviewing conformance , tagging @snorwin and @rikatz for routing

Once there is agreement please review kubernetes-sigs/cloud-provider-kind#471 for being conformant

@youngnick

Copy link
Copy Markdown
Contributor

Hey @lexfrei, we recently updated Gateway API's AI plolicy. Please make sure you read the AI Policy and include a declaration about if AI was used, and if so, what level it was used at, using the AIL scale.

(What you do on Cilium is fine, please feel free to do that).

Tests that seed a status entry owned by another controller need the
status helpers to stop waiting for that entry to catch up with the
object generation: nothing reconciles it, so it never does.

Extend the StaleControllerName exemption RouteMustHaveParents already
has to the BackendTLSPolicy ancestor helpers, and add a
StaleConditionType exemption to FilterStaleConditions for plain
condition lists (Gateway and Listener conditions have no controllerName
to key on, so those tests seed a foreign condition type instead).

Signed-off-by: Aleksei Sviridkin <f@lex.la>
… controllers

Same contract as the HTTPRoute foreign-status test, applied to the other
status list that is scoped by controllerName: policy status.ancestors.
The test seeds an ancestor entry under a stale controllerName, forces a
generation bump, waits for the implementation's own ancestor to catch
up, and requires the seeded entry to survive byte for byte.

Signed-off-by: Aleksei Sviridkin <f@lex.la>
…tions

Gateway and Listener conditions carry no controllerName, so the
cross-controller contract there is different from status.parents and
status.ancestors: implementations must not remove, change or update
conditions whose type they are not responsible for. The test seeds a
condition of a foreign type on the Gateway and on one listener, forces
a generation bump, waits for the implementation's own conditions to
catch up on both levels, and requires the seeded conditions to survive
byte for byte.

Signed-off-by: Aleksei Sviridkin <f@lex.la>
@lexfrei
lexfrei force-pushed the conformance/preserve-foreign-status-policy branch from fa6c9a6 to 00da1c5 Compare September 4, 2026 09:21
@lexfrei

lexfrei commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

@youngnick, reworked all my PRs here.

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

Labels

area/conformance-test Issues or PRs related to Conformance tests. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/test needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. release-note-none Denotes a PR that doesn't merit a release note. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants