mirror of
https://github.com/ansible-collections/kubernetes.core.git
synced 2026-03-26 21:33:02 +00:00
2
changelogs/fragments/387-fix-helm-ignoring-context.yaml
Normal file
2
changelogs/fragments/387-fix-helm-ignoring-context.yaml
Normal file
@@ -0,0 +1,2 @@
|
||||
bugfixes:
|
||||
- helm - fix helm ignoring the kubeconfig context when passed through the ``context`` param or the ``K8S_AUTH_CONTEXT`` environment variable (https://github.com/ansible-collections/community.kubernetes/issues/385).
|
||||
@@ -348,6 +348,24 @@
|
||||
that:
|
||||
result.stat.exists
|
||||
|
||||
- name: Release using non-existent context
|
||||
helm:
|
||||
binary_path: "{{ helm_binary }}"
|
||||
name: test
|
||||
chart_ref: "{{ chart_source }}"
|
||||
chart_version: "{{ chart_source_version | default(omit) }}"
|
||||
namespace: "{{ helm_namespace }}"
|
||||
create_namespace: true
|
||||
context: does-not-exist
|
||||
ignore_errors: yes
|
||||
register: result
|
||||
|
||||
- name: Assert that release fails with non-existent context
|
||||
assert:
|
||||
that:
|
||||
- result is failed
|
||||
- "'context \"does-not-exist\" does not exist' in result.stderr"
|
||||
|
||||
always:
|
||||
- name: Clean up temp dir
|
||||
file:
|
||||
|
||||
@@ -28,8 +28,8 @@ def prepare_helm_environ_update(module):
|
||||
environ_update = {}
|
||||
file_to_cleam_up = None
|
||||
kubeconfig_path = module.params.get('kubeconfig')
|
||||
if module.params.get('kube_context') is not None:
|
||||
environ_update["HELM_KUBECONTEXT"] = module.params.get('kube_context')
|
||||
if module.params.get('context') is not None:
|
||||
environ_update["HELM_KUBECONTEXT"] = module.params.get('context')
|
||||
if module.params.get('release_namespace'):
|
||||
environ_update["HELM_NAMESPACE"] = module.params.get('release_namespace')
|
||||
if module.params.get("api_key"):
|
||||
|
||||
Reference in New Issue
Block a user