mirror of
https://github.com/ansible-collections/kubernetes.core.git
synced 2026-05-07 05:22:39 +00:00
Cleanup sample_plugin during helm tests (#75)
This commit is contained in:
@@ -77,34 +77,42 @@
|
|||||||
- not uninstall_env.changed
|
- not uninstall_env.changed
|
||||||
|
|
||||||
# https://github.com/ansible-collections/community.kubernetes/issues/399
|
# https://github.com/ansible-collections/community.kubernetes/issues/399
|
||||||
- name: Copy required plugin files
|
- block:
|
||||||
copy:
|
- name: Copy required plugin files
|
||||||
src: "files/sample_plugin"
|
copy:
|
||||||
dest: "/tmp/helm_plugin_test/"
|
src: "files/sample_plugin"
|
||||||
|
dest: "/tmp/helm_plugin_test/"
|
||||||
|
|
||||||
- name: Install sample_plugin from the directory
|
- name: Install sample_plugin from the directory
|
||||||
helm_plugin:
|
helm_plugin:
|
||||||
binary_path: "{{ helm_binary }}"
|
binary_path: "{{ helm_binary }}"
|
||||||
state: present
|
state: present
|
||||||
plugin_path: "/tmp/helm_plugin_test/sample_plugin"
|
plugin_path: "/tmp/helm_plugin_test/sample_plugin"
|
||||||
register: sample_plugin_output
|
register: sample_plugin_output
|
||||||
|
|
||||||
- name: Assert that sample_plugin is installed or not
|
- name: Assert that sample_plugin is installed or not
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- sample_plugin_output.changed
|
- sample_plugin_output.changed
|
||||||
|
|
||||||
- name: Gather Helm plugin info
|
- name: Gather Helm plugin info
|
||||||
helm_plugin_info:
|
helm_plugin_info:
|
||||||
register: r
|
register: r
|
||||||
|
|
||||||
- name: Set sample_plugin version
|
- name: Set sample_plugin version
|
||||||
set_fact:
|
set_fact:
|
||||||
plugin_version: "{{ ( r.plugin_list | selectattr('name', 'equalto', plugin_name) | list )[0].version }}"
|
plugin_version: "{{ ( r.plugin_list | selectattr('name', 'equalto', plugin_name) | list )[0].version }}"
|
||||||
vars:
|
vars:
|
||||||
plugin_name: "sample_plugin"
|
plugin_name: "sample_plugin"
|
||||||
|
|
||||||
- name: Assert if sample_plugin with multiline comment is installed
|
- name: Assert if sample_plugin with multiline comment is installed
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- plugin_version == "0.0.1"
|
- plugin_version == "0.0.1"
|
||||||
|
always:
|
||||||
|
- name: Uninstall sample_plugin
|
||||||
|
helm_plugin:
|
||||||
|
binary_path: "{{ helm_binary }}"
|
||||||
|
state: absent
|
||||||
|
plugin_name: sample_plugin
|
||||||
|
ignore_errors: yes
|
||||||
|
|||||||
Reference in New Issue
Block a user