Skip to content

Commit

Permalink
Make unused release_namespace parameter as optional (ansible-collecti…
Browse files Browse the repository at this point in the history
  • Loading branch information
Akasurde authored Feb 3, 2021
1 parent 5a5ed79 commit 86c5c44
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 11 deletions.
3 changes: 3 additions & 0 deletions changelogs/fragments/357_helm_plugin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
bugfixes:
- helm_plugin - make unused ``release_namespace`` parameter as optional (https://github.com/ansible-collections/community.kubernetes/issues/357).
- helm_plugin_info - make unused ``release_namespace`` parameter as optional (https://github.com/ansible-collections/community.kubernetes/issues/357).
7 changes: 0 additions & 7 deletions molecule/default/roles/helm/tasks/tests_helm_plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
- name: Install env plugin in check mode
helm_plugin:
binary_path: "{{ helm_binary }}"
namespace: "{{ helm_namespace }}"
state: present
plugin_path: https://github.com/adamreese/helm-env
register: check_install_env
Expand All @@ -15,7 +14,6 @@
- name: Install env plugin
helm_plugin:
binary_path: "{{ helm_binary }}"
namespace: "{{ helm_namespace }}"
state: present
plugin_path: https://github.com/adamreese/helm-env
register: install_env
Expand All @@ -27,7 +25,6 @@
- name: Gather info about all plugin
helm_plugin_info:
binary_path: "{{ helm_binary }}"
namespace: "{{ helm_namespace }}"
register: plugin_info

- assert:
Expand All @@ -37,7 +34,6 @@
- name: Install env plugin again
helm_plugin:
binary_path: "{{ helm_binary }}"
namespace: "{{ helm_namespace }}"
state: present
plugin_path: https://github.com/adamreese/helm-env
register: install_env
Expand All @@ -49,7 +45,6 @@
- name: Uninstall env plugin in check mode
helm_plugin:
binary_path: "{{ helm_binary }}"
namespace: "{{ helm_namespace }}"
state: absent
plugin_name: env
register: check_uninstall_env
Expand All @@ -62,7 +57,6 @@
- name: Uninstall env plugin
helm_plugin:
binary_path: "{{ helm_binary }}"
namespace: "{{ helm_namespace }}"
state: absent
plugin_name: env
register: uninstall_env
Expand All @@ -74,7 +68,6 @@
- name: Uninstall env plugin again
helm_plugin:
binary_path: "{{ helm_binary }}"
namespace: "{{ helm_namespace }}"
state: absent
plugin_name: env
register: uninstall_env
Expand Down
4 changes: 2 additions & 2 deletions plugins/modules/helm_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
description:
- Manages Helm plugins.
options:
# TODO: (akasurde) Remove this in version 2.0
release_namespace:
description:
- Kubernetes namespace where the helm plugin should be installed.
required: true
type: str
aliases: [ namespace ]
Expand Down Expand Up @@ -103,7 +103,7 @@ def main():
module = AnsibleModule(
argument_spec=dict(
binary_path=dict(type='path'),
release_namespace=dict(type='str', required=True, aliases=['namespace']),
release_namespace=dict(type='str', aliases=['namespace']),
state=dict(type='str', default='present', choices=['present', 'absent']),
plugin_path=dict(type='str',),
plugin_name=dict(type='str',),
Expand Down
4 changes: 2 additions & 2 deletions plugins/modules/helm_plugin_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
description:
- Gather information about Helm plugins installed in namespace.
options:
# TODO: (akasurde) Remove this in version 2.0
release_namespace:
description:
- Kubernetes namespace where the helm plugins are installed.
required: true
type: str
aliases: [ namespace ]
Expand Down Expand Up @@ -84,7 +84,7 @@ def main():
module = AnsibleModule(
argument_spec=dict(
binary_path=dict(type='path'),
release_namespace=dict(type='str', required=True, aliases=['namespace']),
release_namespace=dict(type='str', aliases=['namespace']),
plugin_name=dict(type='str',),
# Helm options
context=dict(type='str', aliases=['kube_context'], fallback=(env_fallback, ['K8S_AUTH_CONTEXT'])),
Expand Down

0 comments on commit 86c5c44

Please sign in to comment.