Skip to content

Commit

Permalink
Addressed review comments
Browse files Browse the repository at this point in the history
Signed-off-by: Abhijit Mukherjee <[email protected]>
  • Loading branch information
mabhi committed Feb 24, 2024
1 parent 302506f commit 32bcd07
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions pkg/handler/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion pkg/validatingwebhook/blueprint_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 32bcd07

Please sign in to comment.