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
Adding ObjectSelector to admission webhooks #78505
Adding ObjectSelector to admission webhooks #78505
Conversation
This PR may require API review. If so, when the changes are ready, complete the pre-review checklist and request an API review. Status of requested reviews is tracked in the API Review project. |
staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/object/matcher.go
Outdated
Show resolved
Hide resolved
staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/object/matcher.go
Show resolved
Hide resolved
staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/object/matcher.go
Outdated
Show resolved
Hide resolved
staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/generic/webhook.go
Show resolved
Hide resolved
staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/mutating/dispatcher.go
Outdated
Show resolved
Hide resolved
staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/validating/dispatcher.go
Outdated
Show resolved
Hide resolved
staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/generic/interfaces.go
Outdated
Show resolved
Hide resolved
staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/generic/interfaces.go
Outdated
Show resolved
Hide resolved
b859b1f
to
814a4a3
Compare
staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/generic/interfaces.go
Show resolved
Hide resolved
@@ -48,6 +48,14 @@ type VersionedAttributes struct { | |||
Dirty bool | |||
} | |||
|
|||
// GetObject overrides the Attributes.GetObject() | |||
func (v *VersionedAttributes) GetObject() runtime.Object { |
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 seems likely to cause confusion... admission attributes GetObject()
functions don't usually contain external objects
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 fine for now, and we have complete test coverage, but a follow-up issue to rework this a little in 1.16 would be good
} | ||
|
||
func newValidatingDispatcher(cm *webhookutil.ClientManager) generic.Dispatcher { | ||
return &validatingDispatcher{cm} | ||
func newValidatingDispatcher(p *Plugin) func(cm *webhookutil.ClientManager) generic.Dispatcher { |
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 works for now, but is pretty awkward, can you open a follow-up issue to avoid needing to inject the full plugin into the dispatchers?
looks like a compile error in |
3b5c1ea
to
7738c7e
Compare
ran against #78309, v1.14.0 compatibility looked good, new fields showed up as expected in the data fixtures for HEAD |
/lgtm API change looks good |
/priority important-soon |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: caesarxuchao, liggitt 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 |
included in docs PR for 1.15 at kubernetes/website#14671 |
/cc @caesarxuchao |
@Ark-kun: GitHub didn't allow me to request PR reviews from the following users: caesarxuchao. Note that only kubernetes members and repo collaborators can review this PR, and authors cannot review their own PRs. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
The type name changed, but the wire serialization of the two types is identical. |
Supersedes #78226.
Based on #78491 and #78080, which are both reviewed and approved already
Implementing KEP#objectSelector and #78226 (comment).
/sig api-machinery
/assign @liggitt @jpbetz @sttts @roycaihw