Skip to content

Commit d475146

Browse files
committed
Remove invalid kustomizeconfig from config/webhook
This change has no effect on the output of this kustomization because the removed configuration was redundant. However, it fixes a bug which can be triggered when using this kustomization as a base for another kustomization. kustomizeconfig contained 3 directives: * nameReference * namespace * varReference varReference remains required until vars are removed from this kustomization. nameReference is redundant because the specified configuration is already in kustomize's defaults. However, nameReference is the important transformation here. namespace is incorrect. It directs the namespace transformer to update webhooks/clientConfig/service/namespace. However, this is not the intended function of the namespace transformer: it should only set the namespace directly on objects and allow references to be updated automatically by nameReference. Configuring it to update a reference directly leaves kustomize with inconsistent internal state. Depending on execution order this can cause a subsequent transformation to fail to update the reference when it makes further changes to the Service object.
1 parent 26c3586 commit d475146

File tree

1 file changed

+2
-23
lines changed

1 file changed

+2
-23
lines changed
Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,4 @@
1-
# the following config is for teaching kustomize where to look at when substituting vars.
2-
# It requires kustomize v2.1.0 or newer to work properly.
3-
nameReference:
4-
- kind: Service
5-
version: v1
6-
fieldSpecs:
7-
- kind: MutatingWebhookConfiguration
8-
group: admissionregistration.k8s.io
9-
path: webhooks/clientConfig/service/name
10-
- kind: ValidatingWebhookConfiguration
11-
group: admissionregistration.k8s.io
12-
path: webhooks/clientConfig/service/name
13-
14-
namespace:
15-
- kind: MutatingWebhookConfiguration
16-
group: admissionregistration.k8s.io
17-
path: webhooks/clientConfig/service/namespace
18-
create: true
19-
- kind: ValidatingWebhookConfiguration
20-
group: admissionregistration.k8s.io
21-
path: webhooks/clientConfig/service/namespace
22-
create: true
23-
1+
# This directive should be removed when vars are removed from this
2+
# kustomization
243
varReference:
254
- path: metadata/annotations

0 commit comments

Comments
 (0)