Skip to content

gep/api/test: refine ListenerSet status semantics and add Conflicted reason#4815

Open
snorwin wants to merge 3 commits into
kubernetes-sigs:mainfrom
snorwin:fix-listenerset-conformance
Open

gep/api/test: refine ListenerSet status semantics and add Conflicted reason#4815
snorwin wants to merge 3 commits into
kubernetes-sigs:mainfrom
snorwin:fix-listenerset-conformance

Conversation

@snorwin
Copy link
Copy Markdown
Member

@snorwin snorwin commented May 1, 2026

What type of PR is this?

/kind cleanup

What this PR does / why we need it:
This PR implements the suggestions I made in #4692 (comment). I decided to bundle the GEP updates, the API changes, and the conformance test changes into a single PR. The main reason is to make the effects of the GEP changes more visible and tangible.

Summary of the GEP changes:

  • The Programmed condition MUST be set to False with an appropriate reason when the Accepted condition is set to False.
  • The Accepted condition has a new reason Conflicted, which MUST be set when the Conflicted condition is set to True.
  • Clarified the semantics of the ParentNotAccepted reason, as well as the effect of a ListenerSet on Gateway acceptance.

Disclaimer: This PR reflects how I would personally resolve the current situation. I'm looking for feedback and happy to adapt it accordingly, my main goal is to create a concrete basis for a more detailed, less high-level discussion.

Which issue(s) this PR fixes:

Fixes #4760

Does this PR introduce a user-facing change?:

TODO

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels May 1, 2026
@k8s-ci-robot k8s-ci-robot requested review from kflynn and rikatz May 1, 2026 09:59
@k8s-ci-robot k8s-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. kind/gep PRs related to Gateway Enhancement Proposal(GEP) size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 1, 2026
@snorwin
Copy link
Copy Markdown
Member Author

snorwin commented May 1, 2026

@k8s-ci-robot k8s-ci-robot requested review from davidjumani and zirain May 1, 2026 10:00
@snorwin
Copy link
Copy Markdown
Member Author

snorwin commented May 1, 2026

/cc @youngnick

@k8s-ci-robot k8s-ci-robot requested a review from youngnick May 1, 2026 10:02
@snorwin snorwin force-pushed the fix-listenerset-conformance branch 2 times, most recently from 94267fb to 78355ae Compare May 1, 2026 13:30
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 8, 2026
Type: string(gatewayv1.ListenerEntryConditionResolvedRefs),
Status: metav1.ConditionTrue,
Reason: "", // any reason
Reason: string(gatewayv1.ListenerEntryReasonResolvedRefs),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should we mandate the reason for it to be accepted ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@davidjumani are there other reasons, that you have in mind, which would be applicable when this condition is true?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

None comes to mind. Was just curious if that was required

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why do we need to restrict the reason?

Copy link
Copy Markdown
Member Author

@snorwin snorwin May 26, 2026

Choose a reason for hiding this comment

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

@zirain I think conformance tests should be as strict as possible. Since the spec doesn't mention any reason for the ResolvedRefs=true condition other than ResolvedRefs itself, why not assert it directly? However, if your implementation uses other valid reasons, I'd be happy to relax the assertion here.

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: davidjumani, snorwin
Once this PR has been reviewed and has the lgtm label, please assign danwinship 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

@davidjumani
Copy link
Copy Markdown
Contributor

/hold

Comment thread pkg/features/tcproute.go
snorwin added 3 commits May 26, 2026 08:39
Signed-off-by: Norwin Schnyder <norwin.schnyder+github@gmail.com>
Signed-off-by: Norwin Schnyder <norwin.schnyder+github@gmail.com>
…nges

Signed-off-by: Norwin Schnyder <norwin.schnyder+github@gmail.com>
@snorwin snorwin force-pushed the fix-listenerset-conformance branch from 78355ae to 365f079 Compare May 26, 2026 06:39
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 26, 2026
Type: string(gatewayv1.ListenerEntryConditionAccepted),
Status: metav1.ConditionFalse,
Reason: string(gatewayv1.ListenerReasonHostnameConflict),
Reason: string(gatewayv1.ListenerEntryReasonConflicted),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is it intentional for this conformance test to require Accepted=False, Reason=Conflicted while allowing any reason for Programmed=False?

Should this use Reason: "" // any reason for Accepted too? The specific conflict is already asserted by Conflicted=True, Reason=HostnameConflict, and there may be multiple valid reasons for Accepted=False.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

For example, a ListenerSet listener could be rejected for a reference issue while also having a hostname conflict:

conditions:
- type: Accepted
  status: "False"
  reason: Invalid 
- type: ResolvedRefs
  status: "False"
  reason: RefNotPermitted
- type: Conflicted
  status: "True"
  reason: HostnameConflict

Copy link
Copy Markdown
Member Author

@snorwin snorwin May 26, 2026

Choose a reason for hiding this comment

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

That's a different topic, you're talking about condition reason precedence, which I don't think is defined anywhere, and this test isn't checking for it either.

We always try to test invalid cases in isolation, so you shouldn't see both RefNotPermitted and Conflicted in the same conformance test. Otherwise, it may indicate that your implementation isn't meeting the prerequisites of the test, there should always be only one specific reason applicable to a given test.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

That makes sense, thanks. I agree conformance tests should isolate invalid cases and avoid testing condition reason precedence.

My concern is that the GEP does not seem to give implementations clear guidance on the Accepted reason here. If the API/GEP text does not define Accepted=False, Reason=Conflicted as the required mapping whenever Conflicted=True, I would suggest not strictly requiring the Accepted reason in this test. The specific conflict is already asserted by Conflicted=True, Reason=HostnameConflict.

If that mapping is intended to be required, should we also state it explicitly in the GEP/API text?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Agreed that the GEP isn't precise about this, but rather than relaxing conformance, I'd prefer to update the GEP itself.

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

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. kind/gep PRs related to Gateway Enhancement Proposal(GEP) release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Conformance] ListenerSet conflict status reasons are inconsistent across API comments, GEP-1713 examples, and current tests

5 participants