Force caBundle to always be quoted (#352)
This fixes issues when you do not provide a value for caBundle that causes validation issues.
This commit is contained in:
parent
3e463a4bbe
commit
70cfec3fc8
2 changed files with 3 additions and 3 deletions
|
@ -14,7 +14,7 @@ webhooks:
|
||||||
name: {{ template "vault.fullname" . }}-agent-injector-svc
|
name: {{ template "vault.fullname" . }}-agent-injector-svc
|
||||||
namespace: {{ .Release.Namespace }}
|
namespace: {{ .Release.Namespace }}
|
||||||
path: "/mutate"
|
path: "/mutate"
|
||||||
caBundle: {{ .Values.injector.certs.caBundle }}
|
caBundle: {{ .Values.injector.certs.caBundle | quote }}
|
||||||
rules:
|
rules:
|
||||||
- operations: ["CREATE", "UPDATE"]
|
- operations: ["CREATE", "UPDATE"]
|
||||||
apiGroups: [""]
|
apiGroups: [""]
|
||||||
|
|
|
@ -42,7 +42,7 @@ load _helpers
|
||||||
[ "${actual}" = "\"foo\"" ]
|
[ "${actual}" = "\"foo\"" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "injector/MutatingWebhookConfiguration: caBundle is empty" {
|
@test "injector/MutatingWebhookConfiguration: caBundle is empty string" {
|
||||||
cd `chart_dir`
|
cd `chart_dir`
|
||||||
local actual=$(helm template \
|
local actual=$(helm template \
|
||||||
--show-only templates/injector-mutating-webhook.yaml \
|
--show-only templates/injector-mutating-webhook.yaml \
|
||||||
|
@ -50,7 +50,7 @@ load _helpers
|
||||||
--namespace foo \
|
--namespace foo \
|
||||||
. | tee /dev/stderr |
|
. | tee /dev/stderr |
|
||||||
yq '.webhooks[0].clientConfig.caBundle' | tee /dev/stderr)
|
yq '.webhooks[0].clientConfig.caBundle' | tee /dev/stderr)
|
||||||
[ "${actual}" = "null" ]
|
[ "${actual}" = "\"\"" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "injector/MutatingWebhookConfiguration: namespaceSelector empty by default" {
|
@test "injector/MutatingWebhookConfiguration: namespaceSelector empty by default" {
|
||||||
|
|
Loading…
Reference in a new issue