-
Notifications
You must be signed in to change notification settings - Fork 617
Revise GEP-1713: Update gateway status and conformance test details for ListenerSets #4205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
@davidjumani thanks, this is a great write of conformance. Do you think it makes sense to also add the expected conditions on each conformance item, and also the ancestorStatus expected, to make it clear to implementations what we will look for? |
Added the expected status as well as added the |
| - The ListenerSet has the following status : | ||
| | Type | Status | Reason | | ||
| | -------- | ------- | ------- | | ||
| | Accepted | True | ListenersNotValid | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this accepted here be false?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on the GEP
// This can be the reason when "Accepted" is "True" or "False", depending on whether
// the listener being invalid causes the entire Gateway to not be accepted.
I believe this should be true since the ListenerSet is configured but does not adversely affect the parent Gateway.
Additionally, there can be a scenario where only a subset of the listeners is invalid and this would more accurately reflect it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but then the reason should be empty or something else, right? It was accepted but not programmed, I guess
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1. If the status is Accepted, there should not be a reason for that.
I wouldn't also mix Accepted: True and Programmed: False in this case. The Programmed condition indicates whether the controller was physically able to apply the requested resources (e.g. allocate an IP or open a port). Listener conflicts are configuration errors, not the controller ability to program them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so. A subset of listeners can be accepted, so the status should reflect it accordingly.
If not all listeners are accepted, then the listenerSet Accepted condition should be false.
Additionally, the Programmed condition should also reflect the same, since a subset of listeners was applied
| - The parent gateway has the following status : | ||
| | Type | Status | Reason | | ||
| | -------- | ------- | ------- | | ||
| | AttachedListenerSets | False | ListenerSetsNotAllowed | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we really need this condition on the parent gateway? I am wondering if in Gateway case we can just not have any count of attached listener, as mostly the user will have its own condition
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the condition should be set since :
- The user has explicitly disallowed ListenerSets
- ListenerSets have been attached (at least tried) to the Gateway
The user should know about this in the status
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not aware of the whole conditions reasoning here tbh, will defer to @youngnick for some better view on it
| - The newer ListenerSet has the following status : | ||
| | Type | Status | Reason | | ||
| | -------- | ------- | ------- | | ||
| | Accepted | True | ListenersNotValid | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
again, should we have an accepted here? And a reason? Not sure if this doesn't get more confusing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a better indication that the listenerSet is correct (the parentref is valid, etc.) but one or more of the listeners is invalid which is indicated by the ListnerStatus above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but one or more of the listeners is invalid which is indicated by the ListnerStatus above
If all listeners in the ListenerSet have conflicts, shouldn't we report the ListenerSet as not accepted? This is consistent with other resources (e.g. if an HTTPRoute has no hostname intersection with a Gateway listener, it's reported a not accepted).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I agree and will update it accordingly. I'll make this clearer with the total number of conflicting listeners
|
@davidjumani overall lgtm! I would like us to keep separated a PR that changes the GEP from a PR that changes the API, this way if we need to track any (or revert) we have proper changes Thanks again for the effort here! |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: davidjumani The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
Thanks for the review @rikatz I've answered the open questions and reverted the API changes. |
rostislavbobo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @davidjumani for a great conformance writeup! Left a couple of comment, let's discuss them today.
| They will validate the following scenarios : | ||
| 1. AllowedListeners is not specified on the parent Gateway | ||
| - `Gateway.spec.allowedListeners` is not specified (defaults to None) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am missing here and in the scenarios below whether the Gateway itself has listeners defined. This could change the statuses below and the outcome, for example, if Gateway listeners and ListenerSet listeners share the same port.
Can we be explicit and state that the Gateways have no listeners defined?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, the Gateway validation requires at least one listener to be defined. I based the tests on this restriction
gateway-api/apis/v1/gateway_types.go
Line 236 in f24f3a6
| // +kubebuilder:validation:MinItems=1 |
|
|
||
| - https://docs.google.com/document/d/1qj7Xog2t2fWRuzOeTsWkabUaVeOF7_2t_7appe8EXwA/edit | ||
|
|
||
| ## Conformance Details |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we clarify that the status is reported per parentRef? A ListenerSet can have different acceptance statuses depending on the Gateway configs it is attached to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A listenerSet can have only one parent as per
| ParentRef ParentGatewayReference `json:"parentRef"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm, I can't recall if there was any substantial discussion around this previously, but it could be possible to add a pluralized version of this field in some future revision if use cases demanded it. I'd kinda rather get the status nesting per-parentRef now (even if it feels redundant/unnecessary, it would mirror similar patterns on many other GWAPI resources) rather than deal with trying to add nesting to an assumed-singular hierarchy later...
| - The ListenerSet has the following status : | ||
| | Type | Status | Reason | | ||
| | -------- | ------- | ------- | | ||
| | Accepted | True | ListenersNotValid | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1. If the status is Accepted, there should not be a reason for that.
I wouldn't also mix Accepted: True and Programmed: False in this case. The Programmed condition indicates whether the controller was physically able to apply the requested resources (e.g. allocate an IP or open a port). Listener conflicts are configuration errors, not the controller ability to program them.
| - The newer ListenerSet has the following status : | ||
| | Type | Status | Reason | | ||
| | -------- | ------- | ------- | | ||
| | Accepted | True | ListenersNotValid | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but one or more of the listeners is invalid which is indicated by the ListnerStatus above
If all listeners in the ListenerSet have conflicts, shouldn't we report the ListenerSet as not accepted? This is consistent with other resources (e.g. if an HTTPRoute has no hostname intersection with a Gateway listener, it's reported a not accepted).
| | AttachedListenerSets | // depends on whether there are any other valid listeners in the attached ListenerSets // | ListenerSetsAttached | | ||
| | AttachedListeners | // total number of child listenerSets // | | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's be clear on numbers and Gateway setup (also see comment). We spend a decent amount of time pondering various options that result in different calculations and statuses, so it'd be grate if we could disambiguate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer that we iron this out in the conformance tests. These serve more as guidelines, as we can always add more tests and update this later. I would like to get something in that we can work towards rather than making a comprehensive test plan that only stays in review
What type of PR is this?
Add one of the following kinds:
/kind documentation
/kind gep
Optionally add one or more of the following kinds if applicable:
/area conformance-test
What this PR does / why we need it:
This PR does the following :
AttachedListenersthat is the count of successful ListenerSet attachments to the gateway. Ref: slack theraadThe aim is to get consensus for the set of conformance tests required to validate this feature against implementations, and move towards promoting this to Standard
Does this PR introduce a user-facing change?: