Skip to content

⚠ Remove deprecated Defaulter and Validator interfaces #2877

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

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 2 additions & 16 deletions pkg/builder/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,15 +176,8 @@ func (blder *WebhookBuilder) getDefaultingWebhook() *admission.Webhook {
}
return w
}
if defaulter, ok := blder.apiType.(admission.Defaulter); ok {
w := admission.DefaultingWebhookFor(blder.mgr.GetScheme(), defaulter)
if blder.recoverPanic != nil {
w = w.WithRecoverPanic(*blder.recoverPanic)
}
return w
}
log.Info(
"skip registering a mutating webhook, object does not implement admission.Defaulter or WithDefaulter wasn't called",
"skip registering a mutating webhook, object does not implement admission.CustomDefaulter or WithCustomDefaulter wasn't called",
"GVK", blder.gvk)
return nil
}
Expand Down Expand Up @@ -215,15 +208,8 @@ func (blder *WebhookBuilder) getValidatingWebhook() *admission.Webhook {
}
return w
}
if validator, ok := blder.apiType.(admission.Validator); ok {
w := admission.ValidatingWebhookFor(blder.mgr.GetScheme(), validator)
if blder.recoverPanic != nil {
w = w.WithRecoverPanic(*blder.recoverPanic)
}
return w
}
log.Info(
"skip registering a validating webhook, object does not implement admission.Validator or WithValidator wasn't called",
"skip registering a validating webhook, object does not implement admission.CustomValidator or WithCustomValidator wasn't called",
"GVK", blder.gvk)
return nil
}
Expand Down
Loading