-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix the vault lookup template env value #116
Conversation
Signed-off-by: gowrisankar <gowrisankar.m01@sap.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix! I think we can improve on this though and leave the original example as-is. It makes sense to have this variable still be a list of strings instead of a single string that happens to represent a list. In the end we do need a string but a list of strings is easier to manage/reason about and is a more accurate representation of this variable's type.
We can get the desired result by doing a join
before quote
'ing. Using quote
alone results in a string representation of the list which is why the default example breaks. By adding join
we get to define the separator and create the string in the correct format.
diff --git a/templates/web-deployment.yaml b/templates/web-deployment.yaml
index d75ad70..0afea90 100644
--- a/templates/web-deployment.yaml
+++ b/templates/web-deployment.yaml
@@ -507,7 +507,7 @@ spec:
{{- end }}
{{- if.Values.concourse.web.vault.lookupTemplates }}
- name: CONCOURSE_VAULT_LOOKUP_TEMPLATES
- value: {{ .Values.concourse.web.vault.lookupTemplates | quote }}
+ value: {{ .Values.concourse.web.vault.lookupTemplates | join "," | quote }}
{{- end }}
- name: CONCOURSE_VAULT_AUTH_BACKEND
value: {{ .Values.concourse.web.vault.authBackend | quote }}
With the above change the web-deployment
template renders a comma separated string instead of a string representation of a list:
- name: CONCOURSE_VAULT_LOOKUP_TEMPLATES
value: "/{{.Team}}/{{.Pipeline}}/{{.Secret}},/{{.Team}}/{{.Secret}}"
vs the original:
- name: CONCOURSE_VAULT_LOOKUP_TEMPLATES
value: "[/{{.Team}}/{{.Pipeline}}/{{.Secret}} /{{.Team}}/{{.Secret}}]"
wdyt?
Signed-off-by: gowrisankar <gowrisankar.m01@sap.com>
@taylorsilva it makes sense. I bumped the change. Please check |
Co-authored-by: Taylor Silva <tsilva@pivotal.io> Signed-off-by: gowrisankar <gowrisankar.m01@sap.com>
Existing Issue
Why do we need this PR?
Fix the lookup template example.
Changes proposed in this pull request
Contributor Checklist
README.md
Reviewer Checklist