generated from kubernetes/kubernetes-template-project
-
Notifications
You must be signed in to change notification settings - Fork 492
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
Add CEL for BackendTLSPolicy targetRefs #3496
Open
snorwin
wants to merge
5
commits into
kubernetes-sigs:main
Choose a base branch
from
snorwin:targetref-cel
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.
+267
−27
Open
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
3674f33
Add CEL for BackendTLSPolicy targetRefs
snorwin 37da93e
Additional test cases with different groups and kinds for BackendTLSP…
snorwin 94ef768
Increase number of targetRefs in BackenTLSPolicy CEL tests
snorwin 76e172c
Add godoc for targetRef CEL validation in BackendTLSPolicy
snorwin 60b7185
Apply PR suggestions
snorwin 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 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
23 changes: 23 additions & 0 deletions
23
config/crd/experimental/gateway.networking.k8s.io_backendtlspolicies.yaml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
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.
https://gateway-api.sigs.k8s.io/reference/spec/#gateway.networking.k8s.io%2fv1.SectionName shows
targetRef
section name would commonly be a port name on a Service, the expected type forBackendTLSPolicy
. For LocalPolicyTargetReferenceWithSectionName, it sayssectionName
is optional and when not specified, refers to the entire resource.After some thought, I wonder if there is any use case where one
targetRef
needs to be associated to a specificsectionName
(port name in the Service), and anothertargetRef
doesn't care which port it targets on that Service. In that case shouldn't it be okay to keep onesectionName
blank, even though the othersectionName
s would have to be specified in order to keep it distinct?Also, I worry about the fact that
sectionName
is optional inLocalPolicyTargetReferenceWithSectionName
. IfLocalPolicyTargetReferenceWithSectionName
is used by another resource, will the same validation for distinct-ness (distinction?) apply, or do we foresee a need to requiresectionName
for distinction here and not when we useLocalPolicyTargetReferenceWithSectionName
in another object? And how confusing would the latter be?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.
cc @youngnick @robscott, since we talked about this today in the community meeting.
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.
In the current version of the CEL, it is valid to keep a
sectionName
blank for one target (e.g., aService
) and specifysectionName
for other targets. However, allowing the same target with and withoutsectionName
and applying the most specific target could be confusing for both implementations and users.Regarding the second concern that upcoming policies might use different validations for the
LocalPolicyTargetReferenceWithSectionName
type, we could either extend the description of the type or introduce aCommonLocalPolicySpec
which could be reused, similar to theCommonRouteSpec
.