For the community.kubernetes.helm module it is documented that the context parameter, its alias kube_context and alternatively the K8S_AUTH_CONTEXT environment variable can be used to control the K8S context used for executing the helm command.
Except for kube_context these configuration options are, however, ignored.
It appears the problem was introduced with PR #324 which made context the primary configuration paramter and kube_context its alias. In this PR it was forgotten to change the prepare_helm_environ_update method as well.
Whats especially devious is that executing Ansible with -vvv reports the correct context being used when this is actually not the case.
-- This is really dangerous and could result in deployments to the wrong environment. --
SUMMARY
For the
community.kubernetes.helm
module it is documented that thecontext
parameter, its aliaskube_context
and alternatively theK8S_AUTH_CONTEXT
environment variable can be used to control the K8S context used for executing the helm command.Except for
kube_context
these configuration options are, however, ignored.It appears the problem was introduced with PR #324 which made
context
the primary configuration paramter andkube_context
its alias. In this PR it was forgotten to change the prepare_helm_environ_update method as well.Whats especially devious is that executing Ansible with
-vvv
reports the correct context being used when this is actually not the case.-- This is really dangerous and could result in deployments to the wrong environment. --
ISSUE TYPE
COMPONENT NAME
community.kubernetes.helm
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
Linux
STEPS TO REPRODUCE
kubectl config use-context context-a
EXPECTED RESULTS
Helm chart is installed to "context-b", as specified in the task properties.
ACTUAL RESULTS
Helm chart is installed to whatever happens to be the current kubectl context at the time. In this case "context-a".