Skip to content

Commit

Permalink
fix: Correct usage of admission.Decoder interface
Browse files Browse the repository at this point in the history
  • Loading branch information
012xx committed Aug 29, 2024
1 parent 6b544f5 commit 111ef0e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions hooks/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (

type applicationValidator struct {
client client.Client
dec *admission.Decoder
dec admission.Decoder
config *config.Config
}

Expand All @@ -45,7 +45,7 @@ func (v *applicationValidator) Handle(ctx context.Context, req admission.Request
}

// SetupApplicationWebhook registers the webhooks for Application
func SetupApplicationWebhook(mgr manager.Manager, dec *admission.Decoder, config *config.Config) {
func SetupApplicationWebhook(mgr manager.Manager, dec admission.Decoder, config *config.Config) {
serv := mgr.GetWebhookServer()

v := &applicationValidator{
Expand Down
6 changes: 3 additions & 3 deletions hooks/tenant.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
//+kubebuilder:webhook:path=/mutate-cattage-cybozu-io-v1beta1-tenant,mutating=true,failurePolicy=fail,sideEffects=None,groups=cattage.cybozu.io,resources=tenants,verbs=create;update,versions=v1beta1,name=mtenant.kb.io,admissionReviewVersions={v1}

type tenantMutator struct {
dec *admission.Decoder
dec admission.Decoder
}

var _ admission.Handler = &tenantMutator{}
Expand Down Expand Up @@ -49,7 +49,7 @@ func (m *tenantMutator) Handle(ctx context.Context, req admission.Request) admis

type tenantValidator struct {
client client.Client
dec *admission.Decoder
dec admission.Decoder
config *config.Config
}

Expand Down Expand Up @@ -107,7 +107,7 @@ func (v *tenantValidator) Handle(ctx context.Context, req admission.Request) adm
}

// SetupTenantWebhook registers the webhooks for Tenant
func SetupTenantWebhook(mgr manager.Manager, dec *admission.Decoder, config *config.Config) {
func SetupTenantWebhook(mgr manager.Manager, dec admission.Decoder, config *config.Config) {
serv := mgr.GetWebhookServer()

m := &tenantMutator{
Expand Down

0 comments on commit 111ef0e

Please sign in to comment.