Skip to content

Commit b19cb86

Browse files
authored
fix version check when reading webhooks from file
1 parent edf7177 commit b19cb86

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/envtest/webhook.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ func readWebhooks(path string) ([]runtime.Object, []runtime.Object, error) {
377377

378378
switch {
379379
case generic.Kind == "MutatingWebhookConfiguration":
380-
if generic.APIVersion != "v1beta1" && generic.APIVersion != "v1" {
380+
if generic.APIVersion != "admissionregistration.k8s.io/v1beta1" && generic.APIVersion != "admissionregistration.k8s.io/v1" {
381381
return nil, nil, fmt.Errorf("only v1beta1 and v1 are supported right now for MutatingWebhookConfiguration (name: %s)", generic.Name)
382382
}
383383
hook := &unstructured.Unstructured{}
@@ -386,7 +386,7 @@ func readWebhooks(path string) ([]runtime.Object, []runtime.Object, error) {
386386
}
387387
mutHooks = append(mutHooks, hook)
388388
case generic.Kind == "ValidatingWebhookConfiguration":
389-
if generic.APIVersion != "v1beta1" && generic.APIVersion != "v1" {
389+
if generic.APIVersion != "admissionregistration.k8s.io/v1beta1" && generic.APIVersion != "admissionregistration.k8s.io/v1" {
390390
return nil, nil, fmt.Errorf("only v1beta1 and v1 are supported right now for ValidatingWebhookConfiguration (name: %s)", generic.Name)
391391
}
392392
hook := &unstructured.Unstructured{}

0 commit comments

Comments
 (0)