VSO Secret Data Transformation with Helm
I keep facing a problem with secret data transformation in Helm Charts.
For example :
spec:
destination:
create: true
name: app-secret
transformation:
excludes:
- .*
templates:
url:
text: |
{{- $host := get .Annotations "myapp.config/postgres-host" -}}
{{- printf "postgresql://%s:%s@%s/postgres?sslmode=disable" (get .Secrets "username") (get .Secrets "password") $host -}}
path: creds/dev-postgres
In the transformation text field, '{{-' forces helm rendering go template wich leads to errors.
I can't find any character escape or file loading tricks with helm to solve this problem.
Does anybody have a solution with helm for this ?
Another solution could be allowing implicit go template syntax for lines in transformation text field, so we could write the lines without specifying '{{-' and '-}}'.
Hi @alexdga, I think the solution you are looking for is here: https://github.com/hashicorp/vault-secrets-operator/issues/619#issuecomment-1984053146 - Please let us know if you require any further assistance.
Closing this issue out, as the solution is mentioned here: https://github.com/hashicorp/vault-secrets-operator/issues/619#issuecomment-1984053146