Skip to content
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

VSO Secret Data Transformation with Helm #674

Open
alexdga opened this issue Apr 3, 2024 · 1 comment
Open

VSO Secret Data Transformation with Helm #674

alexdga opened this issue Apr 3, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@alexdga
Copy link

alexdga commented Apr 3, 2024

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 '-}}'.

@alexdga alexdga added the enhancement New feature or request label Apr 3, 2024
@benashz
Copy link
Collaborator

benashz commented Apr 3, 2024

Hi @alexdga, I think the solution you are looking for is here: #619 (comment) - Please let us know if you require any further assistance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants