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

Allow injecting environment variables into the driver config #400

Open
LiquidPL opened this issue May 16, 2024 · 2 comments · May be fixed by #401
Open

Allow injecting environment variables into the driver config #400

LiquidPL opened this issue May 16, 2024 · 2 comments · May be fixed by #401

Comments

@LiquidPL
Copy link

I'm trying to deploy democratic-csi using ArgoCD and sealed-secrets, and I'd like to avoid having to seal the entire driver config as a secret. I was wondering if it could be possible to somehow inject values from the environment variables into the config, for example:

driver:
  config:
    driver: freenas-api-nfs
    instance_id:
    httpConnection:
      protocol: http
      host: 10.0.0.1
      port: 80
      apiKey: '{{ env "TRUENAS_API_KEY" }}' # or any other sort of marker that would be picked up by the driver

The value of the apiKey field would then be replaced with the api key pulled from the env vars.

@LiquidPL
Copy link
Author

LiquidPL commented May 16, 2024

I found out that this can be accomplished directly in the YAML parser using YAML tags: https://github.com/nodeca/js-yaml/blob/master/examples/custom_types.js. it's now handled differently - see PR

I will try sending in a PR to add this.

@LiquidPL LiquidPL linked a pull request May 16, 2024 that will close this issue
@rouke-broersma
Copy link

This would be great, I have the same setup and the same issue :)

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

Successfully merging a pull request may close this issue.

2 participants