File tree Expand file tree Collapse file tree 4 files changed +66
-1
lines changed Expand file tree Collapse file tree 4 files changed +66
-1
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ webhooks:
40
40
service :
41
41
name : {{ include "ingress-nginx.controller.fullname" . }}-admission
42
42
namespace : {{ include "ingress-nginx.namespace" . }}
43
+ port : {{ .Values.controller.admissionWebhooks.service.servicePort }}
43
44
path : /networking/v1/ingresses
44
45
{{- if .Values.controller.admissionWebhooks.timeoutSeconds }}
45
46
timeoutSeconds : {{ .Values.controller.admissionWebhooks.timeoutSeconds }}
Original file line number Diff line number Diff line change 29
29
{{- end }}
30
30
ports :
31
31
- name : https-webhook
32
- port : 443
32
+ port : {{ .Values.controller.admissionWebhooks.service.servicePort }}
33
33
targetPort : webhook
34
34
{{- if semverCompare ">=1.20.0-0" .Capabilities.KubeVersion.Version }}
35
35
appProtocol : https
Original file line number Diff line number Diff line change
1
+ suite : Admission Webhooks > ValidatingWebhookConfiguration
2
+ templates :
3
+ - admission-webhooks/validating-webhook.yaml
4
+
5
+ tests :
6
+ - it : should not create a ValidatingWebhookConfiguration if `controller.admissionWebhooks.enabled` is false
7
+ set :
8
+ controller.admissionWebhooks.enabled : false
9
+ asserts :
10
+ - hasDocuments :
11
+ count : 0
12
+
13
+ - it : should create a ValidatingWebhookConfiguration if `controller.admissionWebhooks.enabled` is true
14
+ set :
15
+ controller.admissionWebhooks.enabled : true
16
+ asserts :
17
+ - hasDocuments :
18
+ count : 1
19
+ - isKind :
20
+ of : ValidatingWebhookConfiguration
21
+ - equal :
22
+ path : metadata.name
23
+ value : RELEASE-NAME-admission
24
+
25
+ - it : should create a ValidatingWebhookConfiguration with a custom port if `controller.admissionWebhooks.service.servicePort` is set
26
+ set :
27
+ controller.admissionWebhooks.enabled : true
28
+ controller.admissionWebhooks.service.servicePort : 9443
29
+ asserts :
30
+ - equal :
31
+ path : webhooks[0].clientConfig.service.port
32
+ value : 9443
Original file line number Diff line number Diff line change
1
+ suite : Controller > Service > Webhook
2
+ templates :
3
+ - controller-service-webhook.yaml
4
+
5
+ tests :
6
+ - it : should not create a webhook Service if `controller.admissionWebhooks.enabled` is false
7
+ set :
8
+ controller.admissionWebhooks.enabled : false
9
+ asserts :
10
+ - hasDocuments :
11
+ count : 0
12
+
13
+ - it : should create a webhook Service if `controller.admissionWebhooks.enabled` is true
14
+ set :
15
+ controller.admissionWebhooks.enabled : true
16
+ asserts :
17
+ - hasDocuments :
18
+ count : 1
19
+ - isKind :
20
+ of : Service
21
+ - equal :
22
+ path : metadata.name
23
+ value : RELEASE-NAME-ingress-nginx-controller-admission
24
+
25
+ - it : should create a webhook Service with a custom port if `controller.admissionWebhooks.service.servicePort` is set
26
+ set :
27
+ controller.admissionWebhooks.enabled : true
28
+ controller.admissionWebhooks.service.servicePort : 9443
29
+ asserts :
30
+ - equal :
31
+ path : spec.ports[0].port
32
+ value : 9443
You can’t perform that action at this time.
0 commit comments