From b4ee0c0574932b99a9e877c84d880a5f00fdd3cc Mon Sep 17 00:00:00 2001 From: Max Smythe Date: Tue, 25 Oct 2022 16:28:16 -0700 Subject: [PATCH] Move webhook scoping rules into a predicates directory Signed-off-by: Max Smythe --- .../pkg/admission/plugin/webhook/generic/webhook.go | 6 +++--- .../pkg/admission/plugin/webhook/generic/webhook_test.go | 4 ++-- .../plugin/webhook/{ => predicates}/namespace/doc.go | 0 .../plugin/webhook/{ => predicates}/namespace/matcher.go | 0 .../webhook/{ => predicates}/namespace/matcher_test.go | 0 .../admission/plugin/webhook/{ => predicates}/object/doc.go | 0 .../plugin/webhook/{ => predicates}/object/matcher.go | 0 .../plugin/webhook/{ => predicates}/object/matcher_test.go | 0 .../plugin/webhook/{ => predicates}/rules/rules.go | 0 .../plugin/webhook/{ => predicates}/rules/rules_test.go | 0 10 files changed, 5 insertions(+), 5 deletions(-) rename staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/{ => predicates}/namespace/doc.go (100%) rename staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/{ => predicates}/namespace/matcher.go (100%) rename staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/{ => predicates}/namespace/matcher_test.go (100%) rename staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/{ => predicates}/object/doc.go (100%) rename staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/{ => predicates}/object/matcher.go (100%) rename staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/{ => predicates}/object/matcher_test.go (100%) rename staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/{ => predicates}/rules/rules.go (100%) rename staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/{ => predicates}/rules/rules_test.go (100%) diff --git a/staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/generic/webhook.go b/staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/generic/webhook.go index c04225e94f7..e3297aed8f5 100644 --- a/staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/generic/webhook.go +++ b/staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/generic/webhook.go @@ -30,9 +30,9 @@ import ( genericadmissioninit "k8s.io/apiserver/pkg/admission/initializer" "k8s.io/apiserver/pkg/admission/plugin/webhook" "k8s.io/apiserver/pkg/admission/plugin/webhook/config" - "k8s.io/apiserver/pkg/admission/plugin/webhook/namespace" - "k8s.io/apiserver/pkg/admission/plugin/webhook/object" - "k8s.io/apiserver/pkg/admission/plugin/webhook/rules" + "k8s.io/apiserver/pkg/admission/plugin/webhook/predicates/namespace" + "k8s.io/apiserver/pkg/admission/plugin/webhook/predicates/object" + "k8s.io/apiserver/pkg/admission/plugin/webhook/predicates/rules" webhookutil "k8s.io/apiserver/pkg/util/webhook" "k8s.io/client-go/informers" clientset "k8s.io/client-go/kubernetes" diff --git a/staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/generic/webhook_test.go b/staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/generic/webhook_test.go index 26dbefc1991..c564a45e954 100644 --- a/staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/generic/webhook_test.go +++ b/staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/generic/webhook_test.go @@ -30,8 +30,8 @@ import ( "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apiserver/pkg/admission" "k8s.io/apiserver/pkg/admission/plugin/webhook" - "k8s.io/apiserver/pkg/admission/plugin/webhook/namespace" - "k8s.io/apiserver/pkg/admission/plugin/webhook/object" + "k8s.io/apiserver/pkg/admission/plugin/webhook/predicates/namespace" + "k8s.io/apiserver/pkg/admission/plugin/webhook/predicates/object" ) func TestShouldCallHook(t *testing.T) { diff --git a/staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/namespace/doc.go b/staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/predicates/namespace/doc.go similarity index 100% rename from staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/namespace/doc.go rename to staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/predicates/namespace/doc.go diff --git a/staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/namespace/matcher.go b/staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/predicates/namespace/matcher.go similarity index 100% rename from staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/namespace/matcher.go rename to staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/predicates/namespace/matcher.go diff --git a/staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/namespace/matcher_test.go b/staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/predicates/namespace/matcher_test.go similarity index 100% rename from staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/namespace/matcher_test.go rename to staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/predicates/namespace/matcher_test.go diff --git a/staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/object/doc.go b/staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/predicates/object/doc.go similarity index 100% rename from staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/object/doc.go rename to staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/predicates/object/doc.go diff --git a/staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/object/matcher.go b/staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/predicates/object/matcher.go similarity index 100% rename from staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/object/matcher.go rename to staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/predicates/object/matcher.go diff --git a/staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/object/matcher_test.go b/staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/predicates/object/matcher_test.go similarity index 100% rename from staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/object/matcher_test.go rename to staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/predicates/object/matcher_test.go diff --git a/staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/rules/rules.go b/staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/predicates/rules/rules.go similarity index 100% rename from staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/rules/rules.go rename to staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/predicates/rules/rules.go diff --git a/staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/rules/rules_test.go b/staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/predicates/rules/rules_test.go similarity index 100% rename from staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/rules/rules_test.go rename to staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/predicates/rules/rules_test.go