diff --git a/pkg/handler/handler.go b/pkg/handler/handler.go index d1a9b614c52..e4d6919adf1 100644 --- a/pkg/handler/handler.go +++ b/pkg/handler/handler.go @@ -68,11 +68,11 @@ func RunWebhookServer(c *rest.Config) error { log.SetLogger(utils.GetLogger()) mgr, err := manager.New(c, manager.Options{}) if err != nil { - return errors.Wrapf(err, "Failed to create new webhook manager") + return errors.Wrap(err, "Failed to create new webhook manager") } bpValidator := &validatingwebhook.BlueprintValidator{} if err = bpValidator.InjectDecoder(admission.NewDecoder(mgr.GetScheme())); err != nil { - return errors.Wrapf(err, "Failed to inject decoder") + return errors.Wrap(err, "Failed to inject decoder") } hookServerOptions := webhook.Options{CertDir: validatingwebhook.WHCertsDir} @@ -82,7 +82,7 @@ func RunWebhookServer(c *rest.Config) error { hookServer.Register(metricsPath, promhttp.Handler()) if err := mgr.Add(hookServer); err != nil { - return errors.Wrapf(err, "Failed to add new webhook server") + return errors.Wrap(err, "Failed to add new webhook server") } if err := mgr.Start(signals.SetupSignalHandler()); err != nil { diff --git a/pkg/validatingwebhook/blueprint_handler.go b/pkg/validatingwebhook/blueprint_handler.go index ed21644e8c5..4d45172c559 100644 --- a/pkg/validatingwebhook/blueprint_handler.go +++ b/pkg/validatingwebhook/blueprint_handler.go @@ -3,13 +3,13 @@ package validatingwebhook import ( "context" "fmt" + "net/http" "sigs.k8s.io/controller-runtime/pkg/webhook/admission" kanister "github.com/kanisterio/kanister/pkg" crv1alpha1 "github.com/kanisterio/kanister/pkg/apis/cr/v1alpha1" "github.com/kanisterio/kanister/pkg/blueprint/validate" - "net/http" ) type BlueprintValidator struct {