mirror of
https://github.com/ansible-collections/kubernetes.core.git
synced 2026-05-07 21:42:38 +00:00
helm: add support for the K8S_ envvars (#319)
Add support for: - K8S_AUTH_HOST - K8S_AUTH_API_KEY - K8S_AUTH_VERIFY_SSL - K8S_AUTH_SSL_CA_CERT This commit also refactor the way we pass K8S related configuration to `helm`: All the calls are now done in a new module_utils module (`helm.py`). The handling of the `kube_*` variables has also been moved in this new module. We need https://github.com/helm/helm/pull/8622 to be able to ignore the certificate validation. As a workaround, the generate a temporary kubeconfig configuration file. Closes: #279
This commit is contained in:
@@ -12,6 +12,9 @@
|
||||
- name: "Install {{ helm_version }}"
|
||||
include_tasks: install.yml
|
||||
|
||||
- name: "Ensure we honor the environment variables"
|
||||
include_tasks: test_read_envvars.yml
|
||||
|
||||
- name: tests_repository
|
||||
include_tasks: tests_repository.yml
|
||||
|
||||
|
||||
10
molecule/default/roles/helm/tasks/test_read_envvars.yml
Normal file
10
molecule/default/roles/helm/tasks/test_read_envvars.yml
Normal file
@@ -0,0 +1,10 @@
|
||||
- name: Pass a bogus server through the K8S_AUTH_HOST environment variable and ensure helm fails as expected
|
||||
helm:
|
||||
binary_path: "{{ helm_binary }}"
|
||||
state: absent
|
||||
name: does-not-exist
|
||||
namespace: "{{ helm_namespace }}"
|
||||
environment:
|
||||
K8S_AUTH_HOST: somewhere
|
||||
register: _helm_result
|
||||
failed_when: '"http://somewhere/version" not in _helm_result.stderr'
|
||||
Reference in New Issue
Block a user