multiple fixes on molecule helm testing (#121)

This commit is contained in:
abikouo
2021-07-01 14:36:39 +02:00
committed by GitHub
parent 8c7b302916
commit ccc2b61719
6 changed files with 17 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
---
collections:
- kubernetes.core

View File

@@ -15,6 +15,7 @@
- name: Install chart while skipping CRDs - name: Install chart while skipping CRDs
helm: helm:
binary_path: "{{ helm_binary }}"
chart_ref: "/tmp/helm_test_crds/{{ test_chart }}" chart_ref: "/tmp/helm_test_crds/{{ test_chart }}"
namespace: "{{ helm_namespace }}" namespace: "{{ helm_namespace }}"
name: test-crds name: test-crds
@@ -46,12 +47,14 @@
# Helm won't install CRDs into an existing release, so we need to delete this, first # Helm won't install CRDs into an existing release, so we need to delete this, first
- name: Uninstall chart - name: Uninstall chart
helm: helm:
binary_path: "{{ helm_binary }}"
namespace: "{{ helm_namespace }}" namespace: "{{ helm_namespace }}"
name: test-crds name: test-crds
state: absent state: absent
- name: Install chart with CRDs - name: Install chart with CRDs
helm: helm:
binary_path: "{{ helm_binary }}"
chart_ref: "/tmp/helm_test_crds/{{ test_chart }}" chart_ref: "/tmp/helm_test_crds/{{ test_chart }}"
namespace: "{{ helm_namespace }}" namespace: "{{ helm_namespace }}"
name: test-crds name: test-crds

View File

@@ -1,6 +1,7 @@
--- ---
- name: Add chart repo - name: Add chart repo
helm_repository: helm_repository:
binary_path: "{{ helm_binary }}"
name: test_helm name: test_helm
repo_url: "{{ chart_test_repo }}" repo_url: "{{ chart_test_repo }}"
@@ -14,6 +15,7 @@
- name: Add chart repo - name: Add chart repo
helm_repository: helm_repository:
binary_path: "{{ helm_binary }}"
name: test_helm name: test_helm
repo_url: "{{ chart_test_repo }}" repo_url: "{{ chart_test_repo }}"
state: absent state: absent

View File

@@ -6,6 +6,7 @@
block: block:
- name: Install helm diff - name: Install helm diff
helm_plugin: helm_plugin:
binary_path: "{{ helm_binary }}"
state: present state: present
plugin_path: https://github.com/databus23/helm-diff plugin_path: https://github.com/databus23/helm-diff
@@ -136,6 +137,7 @@
- name: Uninstall helm diff - name: Uninstall helm diff
helm_plugin: helm_plugin:
binary_path: "{{ helm_binary }}"
state: absent state: absent
plugin_name: diff plugin_name: diff
ignore_errors: yes ignore_errors: yes

View File

@@ -97,6 +97,7 @@
- name: Gather Helm plugin info - name: Gather Helm plugin info
helm_plugin_info: helm_plugin_info:
binary_path: "{{ helm_binary }}"
register: r register: r
- name: Set sample_plugin version - name: Set sample_plugin version

View File

@@ -1,11 +1,13 @@
--- ---
- name: "Ensure test_helm_repo doesn't exist" - name: "Ensure test_helm_repo doesn't exist"
helm_repository: helm_repository:
binary_path: "{{ helm_binary }}"
name: test_helm_repo name: test_helm_repo
state: absent state: absent
- name: Add test_helm_repo chart repository - name: Add test_helm_repo chart repository
helm_repository: helm_repository:
binary_path: "{{ helm_binary }}"
name: test_helm_repo name: test_helm_repo
repo_url: "{{ chart_test_repo }}" repo_url: "{{ chart_test_repo }}"
register: repository register: repository
@@ -17,6 +19,7 @@
- name: Check idempotency - name: Check idempotency
helm_repository: helm_repository:
binary_path: "{{ helm_binary }}"
name: test_helm_repo name: test_helm_repo
repo_url: "{{ chart_test_repo }}" repo_url: "{{ chart_test_repo }}"
register: repository register: repository
@@ -28,6 +31,7 @@
- name: Failed to add repository with the same name - name: Failed to add repository with the same name
helm_repository: helm_repository:
binary_path: "{{ helm_binary }}"
name: test_helm_repo name: test_helm_repo
repo_url: "https://other-charts.url" repo_url: "https://other-charts.url"
register: repository_errors register: repository_errors
@@ -40,6 +44,7 @@
- name: Remove test_helm_repo chart repository - name: Remove test_helm_repo chart repository
helm_repository: helm_repository:
binary_path: "{{ helm_binary }}"
name: test_helm_repo name: test_helm_repo
state: absent state: absent
register: repository register: repository
@@ -51,6 +56,7 @@
- name: Check idempotency after remove - name: Check idempotency after remove
helm_repository: helm_repository:
binary_path: "{{ helm_binary }}"
name: test_helm_repo name: test_helm_repo
state: absent state: absent
register: repository register: repository