gep/api/test: refine ListenerSet status semantics and add Conflicted reason#4815
gep/api/test: refine ListenerSet status semantics and add Conflicted reason#4815snorwin wants to merge 3 commits into
Conversation
|
/cc @youngnick |
94267fb to
78355ae
Compare
| Type: string(gatewayv1.ListenerEntryConditionResolvedRefs), | ||
| Status: metav1.ConditionTrue, | ||
| Reason: "", // any reason | ||
| Reason: string(gatewayv1.ListenerEntryReasonResolvedRefs), |
There was a problem hiding this comment.
Should we mandate the reason for it to be accepted ?
There was a problem hiding this comment.
@davidjumani are there other reasons, that you have in mind, which would be applicable when this condition is true?
There was a problem hiding this comment.
None comes to mind. Was just curious if that was required
There was a problem hiding this comment.
why do we need to restrict the reason?
There was a problem hiding this comment.
@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.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: davidjumani, snorwin The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/hold |
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>
78355ae to
365f079
Compare
| Type: string(gatewayv1.ListenerEntryConditionAccepted), | ||
| Status: metav1.ConditionFalse, | ||
| Reason: string(gatewayv1.ListenerReasonHostnameConflict), | ||
| Reason: string(gatewayv1.ListenerEntryReasonConflicted), |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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: HostnameConflictThere was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Agreed that the GEP isn't precise about this, but rather than relaxing conformance, I'd prefer to update the GEP itself.
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:
Programmedcondition MUST be set toFalsewith an appropriate reason when theAcceptedcondition is set toFalse.Acceptedcondition has a new reasonConflicted, which MUST be set when theConflictedcondition is set toTrue.ParentNotAcceptedreason, 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?: