EOX GitLab Instance

Skip to content
Snippets Groups Projects
Commit 2b622cf8 authored by Lubomir Dolezal's avatar Lubomir Dolezal
Browse files

add custom quote function for !env tag vars

parent bf5b36a5
No related branches found
No related tags found
No related merge requests found
Pipeline #21250 passed
......@@ -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" }}
......
......@@ -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}}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment