-
Notifications
You must be signed in to change notification settings - Fork 416
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 AdmissionReviewVersions support for webhook #474
Merged
k8s-ci-robot
merged 1 commit into
kubernetes-sigs:master
from
jiachengxu:admission-revirew-versions
Aug 25, 2020
Merged
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 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
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
I'm wondering if this might be nice to keep this as a default for v1, and have
AdmissionReviewVersions: []string{"v1beta1"}
as the default for v1beta1 or not default them (even though it is probably good practice to do so).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.
For
v1beta1
, I think we don't need to default it since it will be defaulted by kube-apiserver to[]string{"v1beta1"}
if it is not specified: https://github.com/kubernetes/api/blob/master/admissionregistration/v1beta1/types.go#L318-L320For
v1
, I am not sure if we should default it. I would slightly prefer to ask the user to setAdmissionReviewVersions
because it is required inv1
, and don't really want to hide this to the user, defaulting it without notifying may cause some unknown issues in their environments/projects. WDYT?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.
On the flip side, breaking marker format for users using defaults isn’t great, although this is a requirement for v1 and they can pretty easily keep using v1beta1 if they choose. Is there a policy on breaking marker format @DirectXMan12 @vincepri?
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.
This is definitely a breaking change as you outlined, if we're supporting both we should have defaults only when necessary. When using v1, we should make sure there is some sort of validation to not break users
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.
If we’re defaulting only when necessary then we probably shouldn’t here, since these need to be set for v1 but controller-gen can’t know which admission review versions the webhook server is using.