generated from kubernetes/kubernetes-template-project
-
Notifications
You must be signed in to change notification settings - Fork 219
add controllerName validation for InferencePool parent status #2029
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
Open
skools-here
wants to merge
1
commit into
kubernetes-sigs:main
Choose a base branch
from
skools-here:controllername-validation
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| package tests | ||
|
|
||
| import ( | ||
| "testing" | ||
|
|
||
| "sigs.k8s.io/gateway-api/conformance/utils/suite" | ||
| "sigs.k8s.io/gateway-api/pkg/features" | ||
|
|
||
| "sigs.k8s.io/gateway-api-inference-extension/conformance/resources" | ||
| k8sutils "sigs.k8s.io/gateway-api-inference-extension/conformance/utils/kubernetes" | ||
| ) | ||
|
|
||
| func init() { | ||
| ConformanceTests = append(ConformanceTests, InferencePoolControllerName) | ||
| } | ||
|
|
||
| var InferencePoolControllerName = suite.ConformanceTest{ | ||
| ShortName: "InferencePoolControllerName", | ||
| Description: "InferencePool status parents should include controllerName", | ||
| Manifests: []string{"tests/inferencepool_accepted.yaml"}, | ||
| Features: []features.FeatureName{ | ||
| features.FeatureName("SupportInferencePool"), | ||
| features.SupportGateway, | ||
| }, | ||
| Test: func(t *testing.T, s *suite.ConformanceTestSuite) { | ||
| poolNN := resources.PrimaryInferencePoolNN | ||
|
|
||
| t.Run("InferencePool parent status reports controllerName", func(t *testing.T) { | ||
| k8sutils.InferencePoolMustHaveControllerName(t, s.Client, poolNN) | ||
| }) | ||
| }, | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
After reading the API here, I'm not sure we want to enforce the controllerName to be populated. It only says "MAY populate". @robscott @danehans
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, we're following RFC-2119 terminology here, so this is currently optional.
With that said, if we do a survey of implementations and find that most/all are already populating this, I think it would make sense to turn
MAYintoMUSTto make this a requirement. I just don't want the conformance test to get ahead of the API spec here. Since the API is already GA, we'll have to be very careful about tightening requirements and ensure that all implementations (or at least as many as we can reach out to) are onboard with this change.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 calling that out.
I see the concern with line 247 enforcing
controllerName, since the API currently marks it as a MAY field per RFC-2119. I don’t want to tighten conformance beyond what the spec guarantees.Would you recommend removing this check entirely for now, or is there an alternative pattern you’d prefer ?