Skip to content

Commit 466ea42

Browse files
authored
fix: allow webhook calls to fail (#2671)
1 parent 6a28241 commit 466ea42

13 files changed

+24
-24
lines changed

config/webhook/manifests.yaml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ webhooks:
1111
name: webhook-service
1212
namespace: system
1313
path: /validate-apisix-apache-org-v2-apisixconsumer
14-
failurePolicy: Fail
14+
failurePolicy: Ignore
1515
name: vapisixconsumer-v2.kb.io
1616
rules:
1717
- apiGroups:
@@ -31,7 +31,7 @@ webhooks:
3131
name: webhook-service
3232
namespace: system
3333
path: /validate-apisix-apache-org-v2-apisixroute
34-
failurePolicy: Fail
34+
failurePolicy: Ignore
3535
name: vapisixroute-v2.kb.io
3636
rules:
3737
- apiGroups:
@@ -51,7 +51,7 @@ webhooks:
5151
name: webhook-service
5252
namespace: system
5353
path: /validate-apisix-apache-org-v2-apisixtls
54-
failurePolicy: Fail
54+
failurePolicy: Ignore
5555
name: vapisixtls-v2.kb.io
5656
rules:
5757
- apiGroups:
@@ -71,7 +71,7 @@ webhooks:
7171
name: webhook-service
7272
namespace: system
7373
path: /validate-apisix-apache-org-v1alpha1-consumer
74-
failurePolicy: Fail
74+
failurePolicy: Ignore
7575
name: vconsumer-v1alpha1.kb.io
7676
rules:
7777
- apiGroups:
@@ -91,7 +91,7 @@ webhooks:
9191
name: webhook-service
9292
namespace: system
9393
path: /validate-gateway-networking-k8s-io-v1-gateway
94-
failurePolicy: Fail
94+
failurePolicy: Ignore
9595
name: vgateway-v1.kb.io
9696
rules:
9797
- apiGroups:
@@ -111,7 +111,7 @@ webhooks:
111111
name: webhook-service
112112
namespace: system
113113
path: /validate-apisix-apache-org-v1alpha1-gatewayproxy
114-
failurePolicy: Fail
114+
failurePolicy: Ignore
115115
name: vgatewayproxy-v1alpha1.kb.io
116116
rules:
117117
- apiGroups:
@@ -131,7 +131,7 @@ webhooks:
131131
name: webhook-service
132132
namespace: system
133133
path: /validate-gateway-networking-k8s-io-v1-grpcroute
134-
failurePolicy: Fail
134+
failurePolicy: Ignore
135135
name: vgrpcroute-v1.kb.io
136136
rules:
137137
- apiGroups:
@@ -151,7 +151,7 @@ webhooks:
151151
name: webhook-service
152152
namespace: system
153153
path: /validate-gateway-networking-k8s-io-v1-httproute
154-
failurePolicy: Fail
154+
failurePolicy: Ignore
155155
name: vhttproute-v1.kb.io
156156
rules:
157157
- apiGroups:
@@ -171,7 +171,7 @@ webhooks:
171171
name: webhook-service
172172
namespace: system
173173
path: /validate-networking-k8s-io-v1-ingress
174-
failurePolicy: Fail
174+
failurePolicy: Ignore
175175
name: vingress-v1.kb.io
176176
rules:
177177
- apiGroups:
@@ -191,7 +191,7 @@ webhooks:
191191
name: webhook-service
192192
namespace: system
193193
path: /validate-networking-k8s-io-v1-ingressclass
194-
failurePolicy: Fail
194+
failurePolicy: Ignore
195195
name: vingressclass-v1.kb.io
196196
rules:
197197
- apiGroups:
@@ -211,7 +211,7 @@ webhooks:
211211
name: webhook-service
212212
namespace: system
213213
path: /validate-gateway-networking-k8s-io-v1alpha2-tcproute
214-
failurePolicy: Fail
214+
failurePolicy: Ignore
215215
name: vtcproute-v1alpha2.kb.io
216216
rules:
217217
- apiGroups:
@@ -231,7 +231,7 @@ webhooks:
231231
name: webhook-service
232232
namespace: system
233233
path: /validate-gateway-networking-k8s-io-v1alpha2-udproute
234-
failurePolicy: Fail
234+
failurePolicy: Ignore
235235
name: vudproute-v1alpha2.kb.io
236236
rules:
237237
- apiGroups:

internal/webhook/v1/apisixconsumer_webhook.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func SetupApisixConsumerWebhookWithManager(mgr ctrl.Manager) error {
4242
Complete()
4343
}
4444

45-
// +kubebuilder:webhook:path=/validate-apisix-apache-org-v2-apisixconsumer,mutating=false,failurePolicy=fail,sideEffects=None,groups=apisix.apache.org,resources=apisixconsumers,verbs=create;update,versions=v2,name=vapisixconsumer-v2.kb.io,admissionReviewVersions=v1
45+
// +kubebuilder:webhook:path=/validate-apisix-apache-org-v2-apisixconsumer,mutating=false,failurePolicy=fail,sideEffects=None,groups=apisix.apache.org,resources=apisixconsumers,verbs=create;update,versions=v2,name=vapisixconsumer-v2.kb.io,admissionReviewVersions=v1,failurePolicy=Ignore
4646

4747
type ApisixConsumerCustomValidator struct {
4848
Client client.Client

internal/webhook/v1/apisixroute_webhook.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func SetupApisixRouteWebhookWithManager(mgr ctrl.Manager) error {
4141
Complete()
4242
}
4343

44-
// +kubebuilder:webhook:path=/validate-apisix-apache-org-v2-apisixroute,mutating=false,failurePolicy=fail,sideEffects=None,groups=apisix.apache.org,resources=apisixroutes,verbs=create;update,versions=v2,name=vapisixroute-v2.kb.io,admissionReviewVersions=v1
44+
// +kubebuilder:webhook:path=/validate-apisix-apache-org-v2-apisixroute,mutating=false,failurePolicy=fail,sideEffects=None,groups=apisix.apache.org,resources=apisixroutes,verbs=create;update,versions=v2,name=vapisixroute-v2.kb.io,admissionReviewVersions=v1,failurePolicy=Ignore
4545

4646
type ApisixRouteCustomValidator struct {
4747
Client client.Client

internal/webhook/v1/apisixtls_webhook.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func SetupApisixTlsWebhookWithManager(mgr ctrl.Manager) error {
4242
Complete()
4343
}
4444

45-
// +kubebuilder:webhook:path=/validate-apisix-apache-org-v2-apisixtls,mutating=false,failurePolicy=fail,sideEffects=None,groups=apisix.apache.org,resources=apisixtlses,verbs=create;update,versions=v2,name=vapisixtls-v2.kb.io,admissionReviewVersions=v1
45+
// +kubebuilder:webhook:path=/validate-apisix-apache-org-v2-apisixtls,mutating=false,failurePolicy=fail,sideEffects=None,groups=apisix.apache.org,resources=apisixtlses,verbs=create;update,versions=v2,name=vapisixtls-v2.kb.io,admissionReviewVersions=v1,failurePolicy=Ignore
4646

4747
type ApisixTlsCustomValidator struct {
4848
Client client.Client

internal/webhook/v1/consumer_webhook.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func SetupConsumerWebhookWithManager(mgr ctrl.Manager) error {
4141
Complete()
4242
}
4343

44-
// +kubebuilder:webhook:path=/validate-apisix-apache-org-v1alpha1-consumer,mutating=false,failurePolicy=fail,sideEffects=None,groups=apisix.apache.org,resources=consumers,verbs=create;update,versions=v1alpha1,name=vconsumer-v1alpha1.kb.io,admissionReviewVersions=v1
44+
// +kubebuilder:webhook:path=/validate-apisix-apache-org-v1alpha1-consumer,mutating=false,failurePolicy=fail,sideEffects=None,groups=apisix.apache.org,resources=consumers,verbs=create;update,versions=v1alpha1,name=vconsumer-v1alpha1.kb.io,admissionReviewVersions=v1,failurePolicy=Ignore
4545

4646
type ConsumerCustomValidator struct {
4747
Client client.Client

internal/webhook/v1/gateway_webhook.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func SetupGatewayWebhookWithManager(mgr ctrl.Manager) error {
4949

5050
// NOTE: The 'path' attribute must follow a specific pattern and should not be modified directly here.
5151
// Modifying the path for an invalid path can cause API server errors; failing to locate the webhook.
52-
// +kubebuilder:webhook:path=/validate-gateway-networking-k8s-io-v1-gateway,mutating=false,failurePolicy=fail,sideEffects=None,groups=gateway.networking.k8s.io,resources=gateways,verbs=create;update,versions=v1,name=vgateway-v1.kb.io,admissionReviewVersions=v1
52+
// +kubebuilder:webhook:path=/validate-gateway-networking-k8s-io-v1-gateway,mutating=false,failurePolicy=fail,sideEffects=None,groups=gateway.networking.k8s.io,resources=gateways,verbs=create;update,versions=v1,name=vgateway-v1.kb.io,admissionReviewVersions=v1,failurePolicy=Ignore
5353

5454
// GatewayCustomValidator struct is responsible for validating the Gateway resource
5555
// when it is created, updated, or deleted.

internal/webhook/v1/gatewayproxy_webhook.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func SetupGatewayProxyWebhookWithManager(mgr ctrl.Manager) error {
4242
Complete()
4343
}
4444

45-
// +kubebuilder:webhook:path=/validate-apisix-apache-org-v1alpha1-gatewayproxy,mutating=false,failurePolicy=fail,sideEffects=None,groups=apisix.apache.org,resources=gatewayproxies,verbs=create;update,versions=v1alpha1,name=vgatewayproxy-v1alpha1.kb.io,admissionReviewVersions=v1
45+
// +kubebuilder:webhook:path=/validate-apisix-apache-org-v1alpha1-gatewayproxy,mutating=false,failurePolicy=fail,sideEffects=None,groups=apisix.apache.org,resources=gatewayproxies,verbs=create;update,versions=v1alpha1,name=vgatewayproxy-v1alpha1.kb.io,admissionReviewVersions=v1,failurePolicy=Ignore
4646

4747
type GatewayProxyCustomValidator struct {
4848
Client client.Client

internal/webhook/v1/grpcroute_webhook.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func SetupGRPCRouteWebhookWithManager(mgr ctrl.Manager) error {
4242
Complete()
4343
}
4444

45-
// +kubebuilder:webhook:path=/validate-gateway-networking-k8s-io-v1-grpcroute,mutating=false,failurePolicy=fail,sideEffects=None,groups=gateway.networking.k8s.io,resources=grpcroutes,verbs=create;update,versions=v1,name=vgrpcroute-v1.kb.io,admissionReviewVersions=v1
45+
// +kubebuilder:webhook:path=/validate-gateway-networking-k8s-io-v1-grpcroute,mutating=false,failurePolicy=fail,sideEffects=None,groups=gateway.networking.k8s.io,resources=grpcroutes,verbs=create;update,versions=v1,name=vgrpcroute-v1.kb.io,admissionReviewVersions=v1,failurePolicy=Ignore
4646

4747
type GRPCRouteCustomValidator struct {
4848
Client client.Client

internal/webhook/v1/httproute_webhook.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func SetupHTTPRouteWebhookWithManager(mgr ctrl.Manager) error {
4242
Complete()
4343
}
4444

45-
// +kubebuilder:webhook:path=/validate-gateway-networking-k8s-io-v1-httproute,mutating=false,failurePolicy=fail,sideEffects=None,groups=gateway.networking.k8s.io,resources=httproutes,verbs=create;update,versions=v1,name=vhttproute-v1.kb.io,admissionReviewVersions=v1
45+
// +kubebuilder:webhook:path=/validate-gateway-networking-k8s-io-v1-httproute,mutating=false,failurePolicy=fail,sideEffects=None,groups=gateway.networking.k8s.io,resources=httproutes,verbs=create;update,versions=v1,name=vhttproute-v1.kb.io,admissionReviewVersions=v1,failurePolicy=Ignore
4646

4747
type HTTPRouteCustomValidator struct {
4848
Client client.Client

internal/webhook/v1/ingress_webhook.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func SetupIngressWebhookWithManager(mgr ctrl.Manager) error {
4444

4545
// NOTE: The 'path' attribute must follow a specific pattern and should not be modified directly here.
4646
// Modifying the path for an invalid path can cause API server errors; failing to locate the webhook.
47-
// +kubebuilder:webhook:path=/validate-networking-k8s-io-v1-ingress,mutating=false,failurePolicy=fail,sideEffects=None,groups=networking.k8s.io,resources=ingresses,verbs=create;update,versions=v1,name=vingress-v1.kb.io,admissionReviewVersions=v1
47+
// +kubebuilder:webhook:path=/validate-networking-k8s-io-v1-ingress,mutating=false,failurePolicy=fail,sideEffects=None,groups=networking.k8s.io,resources=ingresses,verbs=create;update,versions=v1,name=vingress-v1.kb.io,admissionReviewVersions=v1,failurePolicy=Ignore
4848

4949
// IngressCustomValidator struct is responsible for validating the Ingress resource
5050
// when it is created, updated, or deleted.

0 commit comments

Comments
 (0)