mirror of
https://github.com/ansible-collections/kubernetes.core.git
synced 2026-05-08 22:12:44 +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:
|
that:
|
||||||
result.stat.exists
|
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:
|
always:
|
||||||
- name: Clean up temp dir
|
- name: Clean up temp dir
|
||||||
file:
|
file:
|
||||||
|
|||||||
@@ -28,8 +28,8 @@ def prepare_helm_environ_update(module):
|
|||||||
environ_update = {}
|
environ_update = {}
|
||||||
file_to_cleam_up = None
|
file_to_cleam_up = None
|
||||||
kubeconfig_path = module.params.get('kubeconfig')
|
kubeconfig_path = module.params.get('kubeconfig')
|
||||||
if module.params.get('kube_context') is not None:
|
if module.params.get('context') is not None:
|
||||||
environ_update["HELM_KUBECONTEXT"] = module.params.get('kube_context')
|
environ_update["HELM_KUBECONTEXT"] = module.params.get('context')
|
||||||
if module.params.get('release_namespace'):
|
if module.params.get('release_namespace'):
|
||||||
environ_update["HELM_NAMESPACE"] = module.params.get('release_namespace')
|
environ_update["HELM_NAMESPACE"] = module.params.get('release_namespace')
|
||||||
if module.params.get("api_key"):
|
if module.params.get("api_key"):
|
||||||
|
|||||||
Reference in New Issue
Block a user