diff --git a/charts/vs-registrar/files/registrar-config.yaml b/charts/vs-registrar/files/registrar-config.yaml index fd3280c11b5470dc1f730da62f3cae3b6a429d98..4b5f6f55ed728af9ed8d40502d364080b48ebd25 100644 --- a/charts/vs-registrar/files/registrar-config.yaml +++ b/charts/vs-registrar/files/registrar-config.yaml @@ -6,18 +6,20 @@ sources: filter: {{ .filter }} kwargs: {{- if eq $type "swift" }} - username: {{ $val.username | quote }} - password: {{ $val.password | quote }} - project_name: {{ $val.project_name | quote }} - project_id: {{ $val.project_id | quote }} - region_name: {{ $val.region_name | quote }} - auth_url: {{ $val.auth_url | quote }} + username: {{ template "vs-registrar.envVarQuote" $val.username }} + password: {{ template "vs-registrar.envVarQuote" $val.password }} + project_name: {{ template "vs-registrar.envVarQuote" $val.project_name }} + project_id: {{ template "vs-registrar.envVarQuote" $val.project_id }} + region_name: {{ template "vs-registrar.envVarQuote" $val.region_name }} + auth_url: {{ template "vs-registrar.envVarQuote" $val.auth_url }} auth_version: {{ $val.auth_version }} - user_domain_name: {{ $val.user_domain_name | quote }} - user_domain_id: {{ $val.user_domain_id | quote }} - project_domain_name: {{ $val.project_domain_name | quote }} - project_domain_id: {{ $val.project_domain_id | quote }} - container: {{ $val.container | quote }} + user_domain_name: {{ template "vs-registrar.envVarQuote" $val.user_domain_name }} + user_domain_id: {{ template "vs-registrar.envVarQuote" $val.user_domain_id }} + project_domain_name: {{ template "vs-registrar.envVarQuote" $val.project_domain_name }} + project_domain_id: {{ template "vs-registrar.envVarQuote" $val.project_domain_id }} + {{- if $val.container }} + container: {{ template "vs-registrar.envVarQuote" $val.container }} + {{- end }} {{- else if eq $type "s3" }} bucket_name: {{ $val.bucket | default "null" }} endpoint_url: {{ $val.endpoint_url | default "null" }} diff --git a/charts/vs-registrar/templates/_helpers.tpl b/charts/vs-registrar/templates/_helpers.tpl index 8053c968a92d2f76709881a220269e3e788c7355..961eea9c4441865d98e61ee3198fcddc0dd4245f 100644 --- a/charts/vs-registrar/templates/_helpers.tpl +++ b/charts/vs-registrar/templates/_helpers.tpl @@ -60,3 +60,13 @@ Create the name of the service account to use {{- default "default" .Values.serviceAccount.name }} {{- end }} {{- end }} + +{{/* +Transforms "!env string" to !env "string" for env variable masking +*/}} +{{- define "vs-registrar.envVarQuote" -}} +{{- if contains "!env " .}}!env {{( . | replace "!env " "") | quote }} +{{- else if contains "!env" .}}!env {{( . | replace "!env" "") | quote }} +{{- else}}{{ . | quote }} +{{- end}} +{{- end}}