From 6438530fe032d1f3dff1b5dc7e73f80d4176fc4e Mon Sep 17 00:00:00 2001 From: joshvanl Date: Mon, 8 Feb 2021 19:18:49 +0000 Subject: [PATCH] Update webhook Scheme to use and install mutations with mutation registry Signed-off-by: joshvanl --- pkg/webhook/BUILD.bazel | 1 + pkg/webhook/scheme.go | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/pkg/webhook/BUILD.bazel b/pkg/webhook/BUILD.bazel index 76c06d17c..22e4fbe26 100644 --- a/pkg/webhook/BUILD.bazel +++ b/pkg/webhook/BUILD.bazel @@ -6,6 +6,7 @@ go_library( importpath = "github.com/jetstack/cert-manager/pkg/webhook", visibility = ["//visibility:public"], deps = [ + "//pkg/internal/api/mutation:go_default_library", "//pkg/internal/api/validation:go_default_library", "//pkg/internal/apis/acme/install:go_default_library", "//pkg/internal/apis/certmanager/install:go_default_library", diff --git a/pkg/webhook/scheme.go b/pkg/webhook/scheme.go index 030a711aa..ad7269913 100644 --- a/pkg/webhook/scheme.go +++ b/pkg/webhook/scheme.go @@ -19,6 +19,7 @@ package webhook import ( "k8s.io/apimachinery/pkg/runtime" + "github.com/jetstack/cert-manager/pkg/internal/api/mutation" "github.com/jetstack/cert-manager/pkg/internal/api/validation" acmeinstall "github.com/jetstack/cert-manager/pkg/internal/apis/acme/install" cminstall "github.com/jetstack/cert-manager/pkg/internal/apis/certmanager/install" @@ -40,6 +41,10 @@ var ( // ValidationRegistry is a validation registry with all required // validations that should be enforced by the webhook component. ValidationRegistry = validation.NewRegistry(Scheme) + + // MutationRegistry is a mutation registry with all required + // mutations that should be enforced by the webhook component. + MutationRegistry = mutation.NewRegistry(Scheme) ) func init() { @@ -49,4 +54,6 @@ func init() { cminstall.InstallValidation(ValidationRegistry) acmeinstall.InstallValidation(ValidationRegistry) + + cminstall.InstallMutation(MutationRegistry) }