Skip to content

Commit 42d7439

Browse files
author
Mikalai Radchuk
committed
Kustomize ValidatingAdmissionPolicyBinding
This is a workaround for kustomize issue where it does not prefix `ValidatingAdmissionPolicy`'s name in `ValidatingAdmissionPolicyBinding`'s field `spec.policyName`. Instead of using `namePrefix` in `kustomization.yaml` we use `PrefixSuffixTransformer` with custom `fieldSpecs`. Signed-off-by: Mikalai Radchuk <[email protected]>
1 parent 16d5b42 commit 42d7439

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

config/default/kustomization.yaml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,20 @@ namespace: operator-controller-system
66
# "wordpress" becomes "alices-wordpress".
77
# Note that it should also match with the prefix (text before '-') of the namespace
88
# field above.
9-
namePrefix: operator-controller-
9+
transformers:
10+
# This can be replaced by namePrefix once kustomize has support for ValidatingAdmissionPolicyBinding
11+
# https://github.com/kubernetes-sigs/kustomize/issues/5674
12+
- |-
13+
apiVersion: builtin
14+
kind: PrefixSuffixTransformer
15+
metadata:
16+
name: prefix-all-names
17+
prefix: operator-controller-
18+
fieldSpecs:
19+
- path: metadata/name
20+
- group: admissionregistration.k8s.io
21+
kind: ValidatingAdmissionPolicyBinding
22+
path: spec/policyName
1023
1124
# Labels to add to all resources and selectors.
1225
#labels:

0 commit comments

Comments
 (0)