helmsman icon indicating copy to clipboard operation
helmsman copied to clipboard

Flag `--context-override` does not set Helmsman context on `--apply`

Open epierotto opened this issue 4 years ago • 1 comments

When applying a set of DSF files I provide the flag --context-override sample-deployment-stratus and I expect Helmsman to use that context to write the label HELMSMAN_CONTEXT in the Helm secret. Note that I have not context key set in any DSF file, I'm only providing the context only with the flag --context-override sample-deployment-stratus.

Helmsman sets the label HELMSMAN_CONTEXT in the Helm secret to default even when you provide the flag --context-override sample-deployment-stratus.

helmsman version

 _          _
| |        | |
| |__   ___| |_ __ ___  ___ _ __ ___   __ _ _ __
| '_ \ / _ \ | '_ ` _ \/ __| '_ ` _ \ / _` | '_ \
| | | |  __/ | | | | | \__ \ | | | | | (_| | | | |
|_| |_|\___|_|_| |_| |_|___/_| |_| |_|\__,_|_| |_| version: v3.7.0
A Helm-Charts-as-Code tool.

2021-05-25 11:11:14 INFO: No desired state files provided.
kubectl get secret -n pcp-4324-1 -l MANAGED-BY=HELMSMAN -o custom-columns=NAME:.metadata.name,CTX:.metadata.labels.HELMSMAN_CONTEXT --no-headers
sh.helm.release.v1.common-pipeline.v1   default
sh.helm.release.v1.hello-world.v1       default

This is causing that the second time you run the same --apply command Helmsman throws an error because the context are not matching:

2021-05-25 09:52:06 INFO: Preparing plan
2021-05-25 09:52:06 INFO: Acquiring current Helm state from cluster
2021-05-25 09:52:06 DEBUG: helm list --all --max 0 --output json -n pcp-4324-1
2021-05-25 09:52:09 INFO: Overwrote Helmsman context for release [ hello-world ] to sample-deployment-stratus
2021-05-25 09:52:09 INFO: Overwrote Helmsman context for release [ common-pipeline ] to sample-deployment-stratus
2021-05-25 09:52:09 CRITICAL: Release [ hello-world ] in namespace [ pcp-4324-1 ] already exists but is not managed by the current context. Applying changes will likely cause conflicts. Change the release name or namespace.

epierotto avatar May 25 '21 11:05 epierotto

This issue has been marked stale due to an inactivity.

github-actions[bot] avatar Aug 04 '22 05:08 github-actions[bot]