Our build process has a Pipe defined that uses `kubectl-run` to update a Deployment with a new image (built in the previous Pipelines step) and to then update labels on that Deployment with version information (the $BITBUCKET_COMMIT ENV).
The Deployment's image is updated correctly but the labels on the Deployment do not change.
There are no errors in the Pipelines log window or within the Pod's event log.
In the Pipelines log output I can see the part of the `docker run` command for `kubectl-run` with the relevant arguments are all correct:
--env=KUBECTL_COMMAND="set image deployment/APPNAME APPNAME=GROUP/IMAGE:$BITBUCKET_COMMIT" \
When I inspect the Deployment the `DD_TAGS` and `VERSION` labels have not been updated.
Is there some additional config that needs to be done within my Pipe to get this to work?
So if you want update labels your should use something like this:
# execute pipe with your custom command
- pipe: atlassian/kubectl-run:3.1.2
KUBECTL_COMMAND: '<your custom command>'
# update labels here - pipe: atlassian/kubectl-run:3.1.2 variables: KUBE_CONFIG: $KUBE_CONFIG KUBECTL_COMMAND: 'apply' RESOURCE_PATH: '<your path.yml>' LABELS: - 'label1=value1' - 'label2=value2'
We will update the pipe README to point that labels update should be used only with `apply` command.
Hi, Bitbucket community! Are you a DevOps practitioner (or know one in your network)? Do you have DevOps tips, tricks, or learnings you'd like to share with the community? If so, we'd love to hea...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events