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:
Steven Merrill 2020-07-14 09:53:33 -04:00 committed by GitHub
parent 3e463a4bbe
commit 70cfec3fc8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -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: [""]

View file

@ -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" {