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

Variable substitution in Values parameter doesn't work with braces #99

Open
BnMcG opened this issue Aug 7, 2019 · 0 comments
Open

Variable substitution in Values parameter doesn't work with braces #99

BnMcG opened this issue Aug 7, 2019 · 0 comments

Comments

@BnMcG
Copy link

BnMcG commented Aug 7, 2019

After using the plugin this morning, I've found that if I add braces around my variables (as seen in the docs), then variable substitution does not work correctly (at least for values in the Values parameter).

Dropping the braces, leaving just $MYVARIABLE, instead of ${MYVARIABLE} does work, though. Having looked at the code and tests it seems both should be interchangeable, is this not the case?

The value I'm substituting is fetched from a Drone secret. My pipeline step looks something like this:

  - name: deploy-qa
    image: myrepo/drone-helm
    settings:
      chart: mycharts/chart
      skip_tls_verify: true
      debug: true
      release: app-qa
      namespace: qa
      helm_repos: mycharts=https://charts.domain
      client_only: true
      values: rabbitmq.uri=${RABBITMQ_URI},otherThing.uri="http://bla",rabbitmq.exchange="exchange",rabbitmq.bindingKey=#
    environment:
      RABBITMQ_URI:
        from_secret: RABBITMQ_URI
      API_SERVER:
        from_secret: API_SERVER
      KUBERNETES_TOKEN:
        from_secret: KUBERNETES_TOKEN
    when:
      event:
        - promote
      target:
        - qa

In the example above, ${RABBITMQ_URI} isn't substituted, but $RABBITMQ_URI is. In the debug logs, I can see -ReplVar: _RABBITMQ_URI => RABBITMQ_URI-- when I don't add braces, but this is missing with braces around the variable.

So far as I can tell, the variable name matches the regex that the plugin seems to use match environment variables, so I'm unsure why this isn't working. Is this the intended behaviour and I'm just misunderstanding?

I'm using Drone 1.2 with a version of the plugin built from the latest commit on master.

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

No branches or pull requests

1 participant