diff --git a/staging/src/k8s.io/apiserver/pkg/util/webhook/client.go b/staging/src/k8s.io/apiserver/pkg/util/webhook/client.go index 228e9f482aa..0766bcdeec6 100644 --- a/staging/src/k8s.io/apiserver/pkg/util/webhook/client.go +++ b/staging/src/k8s.io/apiserver/pkg/util/webhook/client.go @@ -66,14 +66,14 @@ func NewClientManager(gv schema.GroupVersion, addToSchemaFunc func(s *runtime.Sc if err != nil { return ClientManager{}, err } - admissionScheme := runtime.NewScheme() - if err := addToSchemaFunc(admissionScheme); err != nil { + hookScheme := runtime.NewScheme() + if err := addToSchemaFunc(hookScheme); err != nil { return ClientManager{}, err } return ClientManager{ cache: cache, negotiatedSerializer: serializer.NegotiatedSerializerWrapper(runtime.SerializerInfo{ - Serializer: serializer.NewCodecFactory(admissionScheme).LegacyCodec(gv), + Serializer: serializer.NewCodecFactory(hookScheme).LegacyCodec(gv), }), }, nil } diff --git a/staging/src/k8s.io/apiserver/pkg/util/webhook/error.go b/staging/src/k8s.io/apiserver/pkg/util/webhook/error.go index 9e3b55dfbfb..4701530205d 100644 --- a/staging/src/k8s.io/apiserver/pkg/util/webhook/error.go +++ b/staging/src/k8s.io/apiserver/pkg/util/webhook/error.go @@ -28,7 +28,7 @@ type ErrCallingWebhook struct { func (e *ErrCallingWebhook) Error() string { if e.Reason != nil { - return fmt.Sprintf("failed calling admission webhook %q: %v", e.WebhookName, e.Reason) + return fmt.Sprintf("failed calling webhook %q: %v", e.WebhookName, e.Reason) } - return fmt.Sprintf("failed calling admission webhook %q; no further details available", e.WebhookName) + return fmt.Sprintf("failed calling webhook %q; no further details available", e.WebhookName) } diff --git a/staging/src/k8s.io/apiserver/pkg/util/webhook/webhook.go b/staging/src/k8s.io/apiserver/pkg/util/webhook/webhook.go index 3b03fd3fd5e..eb6c17bdb6b 100755 --- a/staging/src/k8s.io/apiserver/pkg/util/webhook/webhook.go +++ b/staging/src/k8s.io/apiserver/pkg/util/webhook/webhook.go @@ -37,7 +37,7 @@ const defaultRequestTimeout = 30 * time.Second type GenericWebhook struct { RestClient *rest.RESTClient - initialBackoff time.Duration + InitialBackoff time.Duration } // NewGenericWebhook creates a new GenericWebhook from the provided kubeconfig file. @@ -83,7 +83,7 @@ func newGenericWebhook(scheme *runtime.Scheme, codecFactory serializer.CodecFact // it returns an error for which apierrors.SuggestsClientDelay() or apierrors.IsInternalError() returns true. func (g *GenericWebhook) WithExponentialBackoff(webhookFn func() rest.Result) rest.Result { var result rest.Result - WithExponentialBackoff(g.initialBackoff, func() error { + WithExponentialBackoff(g.InitialBackoff, func() error { result = webhookFn() return result.Error() })