Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Bitbucket is injecting environment variable into my values.yaml file

Quintonn Rothmann April 26, 2023

I have a values.yaml file that I use in a helm command in my bitbucket pipeline.

I created a custom pipeline that I run manually.

Below are the beginning parts of my pipeline:

- step: &deploy-my-project
        name: Deploy My Project
        image: ubuntu:latest
        services:
          - docker
        caches:
          - node
          - docker
          - apt
        script:
          - cat "account-setup/scripts/argocd/values.yaml"

At this point, all instances of the word "password" in the file have been replaced with one of my environment variables.

An example:
this:
abc.password.value: "put something here" #TODO remove
Has been replaced with this:
abc.$MY_ADMIN_PASSWORD.value: "put something here" #TODO remove
Why is this happening?
How do I fix this?

I have tried changing the name of the file and that hasn't helped.

Any help would be much appreciated.
Thanks

1 answer

1 accepted

0 votes
Answer accepted
Ben
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 26, 2023

Hey Quintonn,

The environment variable will be injected if you have a secured variable that contains this value to obscure it from view.

For example, say you have a secured variable called $TEST with a value of "helloworld", if you then reference helloworld in plaintext in your configuration - it will automatically insert $TEST as a placeholder to prevent this value from being exposed.

Please review your $MY_ADMIN_PASSWORD variable - you can test by deleting it or changing the value to something completely different to see if it is still inserted when you enter "password". 

Cheers!

- Ben (Bitbucket Cloud Support)

Quintonn Rothmann April 28, 2023

Hi,

This is indeed the case.
I did notice this, and I thought my pipeline was failing because it was actually putting the $ value into my files, but it seems it's only for log output.

My problem was unrelated to the passwords and I've figured it out already. Thanks.


Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events