Skip to content

Commit

Permalink
Adapt webhook admission to accept mgr.GetScheme() as first argument.
Browse files Browse the repository at this point in the history
  • Loading branch information
ary1992 committed Jun 23, 2023
1 parent 88c8bc6 commit a166665
Show file tree
Hide file tree
Showing 13 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const (
// AddToManager adds Handler to the given manager.
func (h *Handler) AddToManager(mgr manager.Manager) error {
webhook := admission.
WithCustomValidator(&corev1.Secret{}, h).
WithCustomValidator(mgr.GetScheme(), &corev1.Secret{}, h).
WithRecoverPanic(true)

mgr.GetWebhookServer().Register(WebhookPath, webhook)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const (
// AddToManager adds Handler to the given manager.
func (h *Handler) AddToManager(mgr manager.Manager) error {
webhook := admission.
WithCustomValidator(&corev1.Secret{}, h).
WithCustomValidator(mgr.GetScheme(), &corev1.Secret{}, h).
WithRecoverPanic(true)

mgr.GetWebhookServer().Register(WebhookPath, webhook)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (h *Handler) AddToManager(ctx context.Context, mgr manager.Manager) error {
}

webhook := admission.
WithCustomValidator(&corev1.Namespace{}, h).
WithCustomValidator(mgr.GetScheme(), &corev1.Namespace{}, h).
WithRecoverPanic(true)

mgr.GetWebhookServer().Register(WebhookPath, webhook)
Expand Down
2 changes: 1 addition & 1 deletion pkg/operator/webhook/defaulting/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const (
// AddToManager adds Handler to the given manager.
func (h *Handler) AddToManager(mgr manager.Manager) error {
webhook := admission.
WithCustomDefaulter(&operatorv1alpha1.Garden{}, h).
WithCustomDefaulter(mgr.GetScheme(), &operatorv1alpha1.Garden{}, h).
WithRecoverPanic(true)

mgr.GetWebhookServer().Register(WebhookPath, webhook)
Expand Down
2 changes: 1 addition & 1 deletion pkg/operator/webhook/validation/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const (
// AddToManager adds Handler to the given manager.
func (h *Handler) AddToManager(mgr manager.Manager) error {
webhook := admission.
WithCustomValidator(&operatorv1alpha1.Garden{}, h).
WithCustomValidator(mgr.GetScheme(), &operatorv1alpha1.Garden{}, h).
WithRecoverPanic(true)

mgr.GetWebhookServer().Register(WebhookPath, webhook)
Expand Down
2 changes: 1 addition & 1 deletion pkg/resourcemanager/webhook/endpointslicehints/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const (
// AddToManager adds Handler to the given manager.
func (h *Handler) AddToManager(mgr manager.Manager) error {
webhook := admission.
WithCustomDefaulter(&discoveryv1.EndpointSlice{}, h).
WithCustomDefaulter(mgr.GetScheme(), &discoveryv1.EndpointSlice{}, h).
WithRecoverPanic(true)

mgr.GetWebhookServer().Register(WebhookPath, webhook)
Expand Down
2 changes: 1 addition & 1 deletion pkg/resourcemanager/webhook/kubernetesservicehost/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const (
// AddToManager adds Handler to the given manager.
func (h *Handler) AddToManager(mgr manager.Manager) error {
webhook := admission.
WithCustomDefaulter(&corev1.Pod{}, h).
WithCustomDefaulter(mgr.GetScheme(), &corev1.Pod{}, h).
WithRecoverPanic(true)

mgr.GetWebhookServer().Register(WebhookPath, webhook)
Expand Down
2 changes: 1 addition & 1 deletion pkg/resourcemanager/webhook/podschedulername/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const (
// AddToManager adds Handler to the given manager.
func (h *Handler) AddToManager(mgr manager.Manager) error {
webhook := admission.
WithCustomDefaulter(&corev1.Pod{}, h).
WithCustomDefaulter(mgr.GetScheme(), &corev1.Pod{}, h).
WithRecoverPanic(true)

mgr.GetWebhookServer().Register(WebhookPath, webhook)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const (
// AddToManager adds Handler to the given manager.
func (h *Handler) AddToManager(mgr manager.Manager) error {
webhook := admission.
WithCustomDefaulter(&corev1.Pod{}, h).
WithCustomDefaulter(mgr.GetScheme(), &corev1.Pod{}, h).
WithRecoverPanic(true)

mgr.GetWebhookServer().Register(WebhookPath, webhook)
Expand Down
2 changes: 1 addition & 1 deletion pkg/resourcemanager/webhook/projectedtokenmount/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const (
// AddToManager adds Handler to the given manager.
func (h *Handler) AddToManager(mgr manager.Manager) error {
webhook := admission.
WithCustomDefaulter(&corev1.Pod{}, h).
WithCustomDefaulter(mgr.GetScheme(), &corev1.Pod{}, h).
WithRecoverPanic(true)

mgr.GetWebhookServer().Register(WebhookPath, webhook)
Expand Down
2 changes: 1 addition & 1 deletion pkg/resourcemanager/webhook/seccompprofile/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const (
// AddToManager adds Handler to the given manager.
func (h *Handler) AddToManager(mgr manager.Manager) error {
webhook := admission.
WithCustomDefaulter(&corev1.Pod{}, h).
WithCustomDefaulter(mgr.GetScheme(), &corev1.Pod{}, h).
WithRecoverPanic(true)

mgr.GetWebhookServer().Register(WebhookPath, webhook)
Expand Down
2 changes: 1 addition & 1 deletion pkg/resourcemanager/webhook/systemcomponentsconfig/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const (
// AddToManager adds Handler to the given manager.
func (h *Handler) AddToManager(mgr manager.Manager) error {
webhook := admission.
WithCustomDefaulter(&corev1.Pod{}, h).
WithCustomDefaulter(mgr.GetScheme(), &corev1.Pod{}, h).
WithRecoverPanic(true)

mgr.GetWebhookServer().Register(WebhookPath, webhook)
Expand Down
2 changes: 1 addition & 1 deletion pkg/resourcemanager/webhook/tokeninvalidator/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const (
// AddToManager adds Handler to the given manager.
func (h *Handler) AddToManager(mgr manager.Manager) error {
webhook := admission.
WithCustomDefaulter(&corev1.Secret{}, h).
WithCustomDefaulter(mgr.GetScheme(), &corev1.Secret{}, h).
WithRecoverPanic(true)

mgr.GetWebhookServer().Register(WebhookPath, webhook)
Expand Down

0 comments on commit a166665

Please sign in to comment.