diff --git a/pkg/admission/admission.go b/pkg/admission/admission.go index 77775a8c..675c4e36 100644 --- a/pkg/admission/admission.go +++ b/pkg/admission/admission.go @@ -87,9 +87,10 @@ func NewMutatingWebhook( caBundle []byte, namespaceSelector *metav1.LabelSelector, objectSelector *metav1.LabelSelector, + failurePolicy admissionregv1.FailurePolicyType, rules []admissionregv1.RuleWithOperations, ) admissionregv1.MutatingWebhook { - failurePolicy := admissionregv1.Fail + //failurePolicy := admissionregv1.Fail matchPolicy := admissionregv1.Exact sideEffect := admissionregv1.SideEffectClassNone @@ -129,9 +130,10 @@ func NewValidatingWebhook( caBundle []byte, namespaceSelector *metav1.LabelSelector, objectSelector *metav1.LabelSelector, + failurePolicy admissionregv1.FailurePolicyType, rules []admissionregv1.RuleWithOperations, ) admissionregv1.ValidatingWebhook { - failurePolicy := admissionregv1.Fail + //failurePolicy := admissionregv1.Fail matchPolicy := admissionregv1.Exact sideEffect := admissionregv1.SideEffectClassNone diff --git a/pkg/injector/webhook.go b/pkg/injector/webhook.go index bfbf18a8..705efae1 100644 --- a/pkg/injector/webhook.go +++ b/pkg/injector/webhook.go @@ -72,6 +72,7 @@ func RegisterWebhooks(webhookSvcNs, webhookSvcName string, caBundle []byte) { }, }, nil, + admissionregv1.Ignore, []admissionregv1.RuleWithOperations{rule}, ) diff --git a/pkg/webhooks/cluster/cluster_webhook.go b/pkg/webhooks/cluster/cluster_webhook.go index 2a4a3dad..1966b553 100644 --- a/pkg/webhooks/cluster/cluster_webhook.go +++ b/pkg/webhooks/cluster/cluster_webhook.go @@ -70,6 +70,7 @@ func RegisterWebhooks(webhookSvcNs, webhookSvcName string, caBundle []byte) { caBundle, nil, nil, + admissionregv1.Fail, []admissionregv1.RuleWithOperations{rule}, ) @@ -81,6 +82,7 @@ func RegisterWebhooks(webhookSvcNs, webhookSvcName string, caBundle []byte) { caBundle, nil, nil, + admissionregv1.Fail, []admissionregv1.RuleWithOperations{rule}, ) diff --git a/pkg/webhooks/cm/config_webhook.go b/pkg/webhooks/cm/config_webhook.go index 8ebf4db2..9fac1467 100644 --- a/pkg/webhooks/cm/config_webhook.go +++ b/pkg/webhooks/cm/config_webhook.go @@ -73,6 +73,7 @@ func RegisterWebhooks(webhookSvcNs, webhookSvcName string, caBundle []byte) { caBundle, nsSelector, nil, + admissionregv1.Ignore, []admissionregv1.RuleWithOperations{rule}, ) @@ -84,6 +85,7 @@ func RegisterWebhooks(webhookSvcNs, webhookSvcName string, caBundle []byte) { caBundle, nsSelector, nil, + admissionregv1.Ignore, []admissionregv1.RuleWithOperations{rule}, ) diff --git a/pkg/webhooks/flb/secret/webhook.go b/pkg/webhooks/flb/secret/webhook.go index b22d383a..2303ee34 100644 --- a/pkg/webhooks/flb/secret/webhook.go +++ b/pkg/webhooks/flb/secret/webhook.go @@ -68,6 +68,7 @@ func RegisterWebhooks(webhookSvcNs, webhookSvcName string, caBundle []byte) { commons.FlbSecretLabel: "true", }, }, + admissionregv1.Ignore, []admissionregv1.RuleWithOperations{rule}, ) @@ -83,6 +84,7 @@ func RegisterWebhooks(webhookSvcNs, webhookSvcName string, caBundle []byte) { commons.FlbSecretLabel: "true", }, }, + admissionregv1.Ignore, []admissionregv1.RuleWithOperations{rule}, ) diff --git a/pkg/webhooks/flb/service/webhook.go b/pkg/webhooks/flb/service/webhook.go index 222e78c1..acbb0dbe 100644 --- a/pkg/webhooks/flb/service/webhook.go +++ b/pkg/webhooks/flb/service/webhook.go @@ -65,6 +65,7 @@ func RegisterWebhooks(webhookSvcNs, webhookSvcName string, caBundle []byte) { caBundle, nil, nil, + admissionregv1.Ignore, []admissionregv1.RuleWithOperations{rule}, ) @@ -76,6 +77,7 @@ func RegisterWebhooks(webhookSvcNs, webhookSvcName string, caBundle []byte) { caBundle, nil, nil, + admissionregv1.Ignore, []admissionregv1.RuleWithOperations{rule}, ) diff --git a/pkg/webhooks/gateway/gateway_webhook.go b/pkg/webhooks/gateway/gateway_webhook.go index 2b8c3367..47ff4841 100644 --- a/pkg/webhooks/gateway/gateway_webhook.go +++ b/pkg/webhooks/gateway/gateway_webhook.go @@ -65,6 +65,7 @@ func RegisterWebhooks(webhookSvcNs, webhookSvcName string, caBundle []byte) { caBundle, nil, nil, + admissionregv1.Ignore, []admissionregv1.RuleWithOperations{rule}, ) @@ -76,6 +77,7 @@ func RegisterWebhooks(webhookSvcNs, webhookSvcName string, caBundle []byte) { caBundle, nil, nil, + admissionregv1.Ignore, []admissionregv1.RuleWithOperations{rule}, ) diff --git a/pkg/webhooks/gatewayclass/gatewayclass_webhook.go b/pkg/webhooks/gatewayclass/gatewayclass_webhook.go index 36c8d5f2..88b6665a 100644 --- a/pkg/webhooks/gatewayclass/gatewayclass_webhook.go +++ b/pkg/webhooks/gatewayclass/gatewayclass_webhook.go @@ -65,6 +65,7 @@ func RegisterWebhooks(webhookSvcNs, webhookSvcName string, caBundle []byte) { caBundle, nil, nil, + admissionregv1.Ignore, []admissionregv1.RuleWithOperations{rule}, ) @@ -76,6 +77,7 @@ func RegisterWebhooks(webhookSvcNs, webhookSvcName string, caBundle []byte) { caBundle, nil, nil, + admissionregv1.Ignore, []admissionregv1.RuleWithOperations{rule}, ) diff --git a/pkg/webhooks/globaltrafficpolicy/webhook.go b/pkg/webhooks/globaltrafficpolicy/webhook.go index 18162721..efe0ad8f 100644 --- a/pkg/webhooks/globaltrafficpolicy/webhook.go +++ b/pkg/webhooks/globaltrafficpolicy/webhook.go @@ -64,6 +64,7 @@ func RegisterWebhooks(webhookSvcNs, webhookSvcName string, caBundle []byte) { caBundle, nil, nil, + admissionregv1.Fail, []admissionregv1.RuleWithOperations{rule}, ) @@ -75,6 +76,7 @@ func RegisterWebhooks(webhookSvcNs, webhookSvcName string, caBundle []byte) { caBundle, nil, nil, + admissionregv1.Fail, []admissionregv1.RuleWithOperations{rule}, ) diff --git a/pkg/webhooks/httproute/httproute_webhook.go b/pkg/webhooks/httproute/httproute_webhook.go index abacde40..267faef2 100644 --- a/pkg/webhooks/httproute/httproute_webhook.go +++ b/pkg/webhooks/httproute/httproute_webhook.go @@ -65,6 +65,7 @@ func RegisterWebhooks(webhookSvcNs, webhookSvcName string, caBundle []byte) { caBundle, nil, nil, + admissionregv1.Ignore, []admissionregv1.RuleWithOperations{rule}, ) @@ -76,6 +77,7 @@ func RegisterWebhooks(webhookSvcNs, webhookSvcName string, caBundle []byte) { caBundle, nil, nil, + admissionregv1.Ignore, []admissionregv1.RuleWithOperations{rule}, ) diff --git a/pkg/webhooks/ingress/webhook.go b/pkg/webhooks/ingress/webhook.go index 63c28c6b..17d067db 100644 --- a/pkg/webhooks/ingress/webhook.go +++ b/pkg/webhooks/ingress/webhook.go @@ -66,6 +66,7 @@ func RegisterWebhooks(webhookSvcNs, webhookSvcName string, caBundle []byte) { caBundle, nil, nil, + admissionregv1.Ignore, []admissionregv1.RuleWithOperations{rule}, ) @@ -77,6 +78,7 @@ func RegisterWebhooks(webhookSvcNs, webhookSvcName string, caBundle []byte) { caBundle, nil, nil, + admissionregv1.Ignore, []admissionregv1.RuleWithOperations{rule}, ) diff --git a/pkg/webhooks/namespacedingress/namespacedingress_webhook.go b/pkg/webhooks/namespacedingress/namespacedingress_webhook.go index df287f3c..240ddf74 100644 --- a/pkg/webhooks/namespacedingress/namespacedingress_webhook.go +++ b/pkg/webhooks/namespacedingress/namespacedingress_webhook.go @@ -68,6 +68,7 @@ func RegisterWebhooks(webhookSvcNs, webhookSvcName string, caBundle []byte) { caBundle, nil, nil, + admissionregv1.Fail, []admissionregv1.RuleWithOperations{rule}, ) @@ -79,6 +80,7 @@ func RegisterWebhooks(webhookSvcNs, webhookSvcName string, caBundle []byte) { caBundle, nil, nil, + admissionregv1.Fail, []admissionregv1.RuleWithOperations{rule}, ) diff --git a/pkg/webhooks/proxyprofile/proxyprofile_webhook.go b/pkg/webhooks/proxyprofile/proxyprofile_webhook.go index f9089aa3..26f48f57 100644 --- a/pkg/webhooks/proxyprofile/proxyprofile_webhook.go +++ b/pkg/webhooks/proxyprofile/proxyprofile_webhook.go @@ -66,6 +66,7 @@ func RegisterWebhooks(webhookSvcNs, webhookSvcName string, caBundle []byte) { caBundle, nil, nil, + admissionregv1.Fail, []admissionregv1.RuleWithOperations{rule}, ) @@ -77,6 +78,7 @@ func RegisterWebhooks(webhookSvcNs, webhookSvcName string, caBundle []byte) { caBundle, nil, nil, + admissionregv1.Fail, []admissionregv1.RuleWithOperations{rule}, ) diff --git a/pkg/webhooks/serviceexport/webhook.go b/pkg/webhooks/serviceexport/webhook.go index 82dc08a8..3d8cd7dc 100644 --- a/pkg/webhooks/serviceexport/webhook.go +++ b/pkg/webhooks/serviceexport/webhook.go @@ -62,6 +62,7 @@ func RegisterWebhooks(webhookSvcNs, webhookSvcName string, caBundle []byte) { caBundle, nil, nil, + admissionregv1.Fail, []admissionregv1.RuleWithOperations{rule}, ) @@ -73,6 +74,7 @@ func RegisterWebhooks(webhookSvcNs, webhookSvcName string, caBundle []byte) { caBundle, nil, nil, + admissionregv1.Fail, []admissionregv1.RuleWithOperations{rule}, ) diff --git a/pkg/webhooks/serviceimport/webhook.go b/pkg/webhooks/serviceimport/webhook.go index 3bc91986..666c30bd 100644 --- a/pkg/webhooks/serviceimport/webhook.go +++ b/pkg/webhooks/serviceimport/webhook.go @@ -63,6 +63,7 @@ func RegisterWebhooks(webhookSvcNs, webhookSvcName string, caBundle []byte) { caBundle, nil, nil, + admissionregv1.Fail, []admissionregv1.RuleWithOperations{rule}, ) @@ -74,6 +75,7 @@ func RegisterWebhooks(webhookSvcNs, webhookSvcName string, caBundle []byte) { caBundle, nil, nil, + admissionregv1.Fail, []admissionregv1.RuleWithOperations{rule}, )