-
Notifications
You must be signed in to change notification settings - Fork 482
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
[Conformance]: Adds GatewayClass SupportedVersion Test #3368
base: main
Are you sure you want to change the base?
Conversation
The change basically lgtm, but you'll need to remove the "fixes ..." from the commit message @danehans, Prow doesn't let us do that in commit messages. |
b073179
to
b40de38
Compare
Commit b40de38 removes "Fixes..." from the commit message. Thanks for the review @youngnick. |
b40de38
to
7463a92
Compare
thanks @danehans, does this test pass on any implementations ? |
@arkodg thanks for the review. Yes, this PR was tested with solo-io/gloo#10140 for Gloo Gateway:
|
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 for working on this @danehans!
Adds a test to ensure implementations conform to the GatewayClass SupportedVersion status condition. Signed-off-by: Daneyon Hansen <[email protected]>
Signed-off-by: Daneyon Hansen <[email protected]>
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 !
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: arkodg, danehans The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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 @danehans!
} | ||
|
||
// Ensure the SupportedVersion is false | ||
kubernetes.GWCMustHaveSupportedVersionConditionFalse(t, s.Client, s.TimeoutConfig, gwc.Name) |
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.
Some implementations like GKE will ~immediately overwrite this CRD with the original version, can you add that as an acceptable outcome of this test?
Features: []features.FeatureName{ | ||
features.SupportGateway, | ||
}, | ||
Description: "A GatewayClass should set the SupportedVersion condition based on the presence and version of Gateway API CRDs in the cluster", |
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'm not sure this makes sense.
Consider I build an implementation that supports v1.1.
v1.2 comes out. Per the spec, even if I am willing to support it, I must set the condition to "false"
This means I cannot pass this conformance test for 1.2 until I upgrade to 1.2 which doesn't actually seem desired?
} | ||
|
||
// Ensure the SupportedVersion status condition is false | ||
kubernetes.GWCMustHaveSupportedVersionConditionFalse(t, s.Client, s.TimeoutConfig, gwc.Name) |
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 expect implementations to have to watch CRDs and constantly reconcile the Gatewayclass? I get how we got to this point, but it feels like we are building APIs in isolation from considerations about user needs and implementation complexity.
Users are unlikely to ever have an incompatibility and somehow realize to check a random object (that they don't even create, so why would they know to look at it?).
The cost to implement this, however, is extremely high...
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.
FWIW the api-machinery folks have, historically, advised against an implementation reading CRDs at all or even assuming an API is defined by a CRD (vs another mechanism).
I realize this has not much to do with the test... but I missed the PR adding the 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 tend to agree with @howardjohn about this feature: it looks like we are tightly coupling the implementation's internal dependency with the installed Gateway API version. In case Implementation X uses Gateway API 1.3 as a dependency, and Gateway API 1.4 gets released, if a user performs an upgrade of the API before the implementation adoption of that specific version, the GatewayClass gets marked as not accepted anymore.
this test is adding conformance for this section https://gateway-api.sigs.k8s.io/guides/api-design/?h=supportedversi#supported-api-versions, if this is undesirable, then the section should be modified |
Yes, my concern is mostly related to the feature itself, not to this specific conformance test |
The docs don't say that the GatewayClass needs to not be accepted, just that the unsupportedVersion Condition needs to be added. The intent here is to give implementations a way to say "hey, you're running with a version I don't support, maybe check that before logging a support issue". That is, it's intended to be a feature that serves both users and maintainers by giving users a way to check that they are doing supported things. @howardjohn I'm certainly ready to hear feedback on how you think that could be achieved without doing the things documented in the test. Or if you think that the goal is not worthwhile, I'd be interested to hear why. |
The intent makes sense at a high level, I am just not sure it makes sense in practice. Its very easy to come up with ideas to put an ever-increasing list of bits of information into an objects status. But we should do so with extreme caution -- each one adds real risk, complexity, and scale limitations. A slippery-slope strawman is we start forcing implementations to start putting their entire documentation in the status (which is not far off from the SupportFeatures field!). If you look at Kubernetes core, you can see they are very conservative in ensure each status is only critical information. The user journeys for this field don't make sense. Which user is going to know to look at a GatewayClass to find this field? The cost to implement this is high for an implementation. API Machinery folks have consistently strongly recommended against controllers assuming an API is created by a CustomResourceDefinition, and instead relying on API server discovery and the standardized REST APIs to consume APIs; this conformance test strictly enforces reading CRDs. |
Apologies in advance: I'm intending this as an actual question, but I expect that it may sound overly snarky, which isn't my intent. That said -- what's the intended user experience here, and which role are we designing for? I can think of a couple of possibilities:
So... overall, I feel like neither of these hold together all that well, which makes me wonder what I'm missing. 🙂 |
Its slightly worse than your examples actually -- the status is on GatewayClass not Gateway, which I feel is less likely to be looked at |
😂 🤦♂️ and I even read the chunk of the doc before writing those out... clearly time for me to knock off work for the day! But you're right: that makes things weirder still. |
The idea behind all of this is to teach users to check the GatewayClass to find out what their controller supports (this is the point of the The original purpose of all of this is to at least include some information about relevant things that didn't require going out to the implementation's docs site to find the details. @howardjohn, it seems like you don't agree with that goal? Or are you worried about the asymptotic case of having too much information in the GatewayClass status? It seems to me that our options here are as follows:
|
What type of PR is this?
/kind test
/area conformance
What this PR does / why we need it:
Adds a test to ensure implementations conform to the GatewayClass SupportedVersion status condition.
Which issue(s) this PR fixes:
Fixes #3367
Does this PR introduce a user-facing change?: