Skip to content

Commit ccdaf75

Browse files
committed
updaes usage of provisionedSecretPrefix to ensure when it's blank in the values it does not leave a leading hyphen in the command that kubectl interprets as a flag
Signed-off-by: Ryan Brady <[email protected]>
1 parent 59b2167 commit ccdaf75

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

production/helm/loki/templates/provisioner/job-provisioner.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,10 @@ spec:
9898
# Note: the following bash commands should always return a success status code.
9999
# Therefore, in case the token file does not exist, the first clause of the
100100
# or-operation is successful.
101+
{{- $prefix := tpl $.Values.enterprise.provisioner.provisionedSecretPrefix $ -}}
101102
{{- range .Values.enterprise.provisioner.additionalTenants }}
102103
! test -s /bootstrap/token-write-{{ .name }} || \
103-
kubectl --namespace "{{ .secretNamespace }}" create secret generic "{{ tpl $.Values.enterprise.provisioner.provisionedSecretPrefix $ }}-{{ .name }}" \
104+
kubectl --namespace "{{ .secretNamespace }}" create secret generic "{{- if $prefix }}{{ $prefix }}-{{ end }}{{ .name }}" \
104105
--from-literal=token-write="$(cat /bootstrap/token-write-{{ .name }})" \
105106
--from-literal=token-read="$(cat /bootstrap/token-read-{{ .name }})"
106107
{{- end }}

0 commit comments

Comments
 (0)