From b42eea04b37c3630362797131550c6216e2c79af Mon Sep 17 00:00:00 2001 From: Mike Graves Date: Fri, 30 Sep 2022 14:47:56 -0400 Subject: [PATCH 1/3] Fix helm test suite The old version of the nginx ingress controller that was being used for helm testing is incompatible with the recent upgrade to k8s 1.25 in CI. This upgrades the version used for testing and fixes a few other related issues. --- tests/integration/targets/helm/defaults/main.yml | 4 ++-- tests/integration/targets/helm/tasks/tests_chart.yml | 7 +++++++ .../targets/helm/tasks/tests_chart/from_repository.yml | 2 +- .../targets/helm/tasks/tests_chart/from_url.yml | 4 ++-- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/tests/integration/targets/helm/defaults/main.yml b/tests/integration/targets/helm/defaults/main.yml index 60a68664bd..a29cd26011 100644 --- a/tests/integration/targets/helm/defaults/main.yml +++ b/tests/integration/targets/helm/defaults/main.yml @@ -4,9 +4,9 @@ helm_binary: "/tmp/helm/{{ ansible_system | lower }}-amd64/helm" chart_test: "ingress-nginx" chart_test_local_path: "nginx-ingress" -chart_test_version: 3.8.0 +chart_test_version: 4.2.4 chart_test_version_local_path: 1.32.0 -chart_test_version_upgrade: 3.9.0 +chart_test_version_upgrade: 4.2.5 chart_test_version_upgrade_local_path: 1.33.0 chart_test_repo: "https://kubernetes.github.io/ingress-nginx" chart_test_git_repo: "http://github.com/helm/charts.git" diff --git a/tests/integration/targets/helm/tasks/tests_chart.yml b/tests/integration/targets/helm/tasks/tests_chart.yml index cd0d6b224a..a0227215b0 100644 --- a/tests/integration/targets/helm/tasks/tests_chart.yml +++ b/tests/integration/targets/helm/tasks/tests_chart.yml @@ -335,6 +335,13 @@ that: - not (install is changed) + - name: "Remove {{ chart_release_name }} release" + helm: + binary_path: "{{ helm_binary }}" + name: "{{ chart_release_name }}" + namespace: "{{ helm_namespace }}" + state: absent + - name: Render templates helm_template: binary_path: "{{ helm_binary }}" diff --git a/tests/integration/targets/helm/tasks/tests_chart/from_repository.yml b/tests/integration/targets/helm/tasks/tests_chart/from_repository.yml index 7187bf2872..d00599a664 100644 --- a/tests/integration/targets/helm/tasks/tests_chart/from_repository.yml +++ b/tests/integration/targets/helm/tasks/tests_chart/from_repository.yml @@ -14,7 +14,7 @@ chart_source_version_upgrade: "{{ chart_test_version_upgrade }}" helm_namespace: "{{ test_namespace[6] }}" -- name: Add chart repo +- name: Remove chart repo helm_repository: binary_path: "{{ helm_binary }}" name: test_helm diff --git a/tests/integration/targets/helm/tasks/tests_chart/from_url.yml b/tests/integration/targets/helm/tasks/tests_chart/from_url.yml index 1286b401df..0d4922ebb4 100644 --- a/tests/integration/targets/helm/tasks/tests_chart/from_url.yml +++ b/tests/integration/targets/helm/tasks/tests_chart/from_url.yml @@ -3,6 +3,6 @@ include_tasks: "../tests_chart.yml" vars: source: url - chart_source: "https://github.com/kubernetes/ingress-nginx/releases/download/{{ chart_test }}-{{ chart_test_version }}/{{ chart_test }}-{{ chart_test_version }}.tgz" - chart_source_upgrade: "https://github.com/kubernetes/ingress-nginx/releases/download/{{ chart_test }}-{{ chart_test_version_upgrade }}/{{ chart_test }}-{{ chart_test_version_upgrade }}.tgz" + chart_source: "https://github.com/kubernetes/ingress-nginx/releases/download/helm-chart-{{ chart_test_version }}/{{ chart_test }}-{{ chart_test_version }}.tgz" + chart_source_upgrade: "https://github.com/kubernetes/ingress-nginx/releases/download/helm-chart-{{ chart_test_version_upgrade }}/{{ chart_test }}-{{ chart_test_version_upgrade }}.tgz" helm_namespace: "{{ test_namespace[5] }}" From d12e73c4c969a055412b74f4023da334e5690155 Mon Sep 17 00:00:00 2001 From: Mike Graves Date: Fri, 30 Sep 2022 15:05:37 -0400 Subject: [PATCH 2/3] Add changelog fragment --- changelogs/fragments/522-fix-helm-tests.yml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 changelogs/fragments/522-fix-helm-tests.yml diff --git a/changelogs/fragments/522-fix-helm-tests.yml b/changelogs/fragments/522-fix-helm-tests.yml new file mode 100644 index 0000000000..808509a6ca --- /dev/null +++ b/changelogs/fragments/522-fix-helm-tests.yml @@ -0,0 +1,3 @@ +--- +trivial: + - fix helm test suite (https://github.com/ansible-collections/kubernetes.core/pull/522). From 1ac0bcffc5644c268dabb91f4b27e4bade6dbeb0 Mon Sep 17 00:00:00 2001 From: Mike Graves Date: Mon, 3 Oct 2022 09:26:37 -0400 Subject: [PATCH 3/3] Increase helm version for tests --- tests/integration/targets/helm/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/targets/helm/tasks/main.yml b/tests/integration/targets/helm/tasks/main.yml index e86d33df22..9d8dda3e7b 100644 --- a/tests/integration/targets/helm/tasks/main.yml +++ b/tests/integration/targets/helm/tasks/main.yml @@ -4,4 +4,4 @@ loop_control: loop_var: helm_version with_items: - - "v3.2.4" + - "v3.7.0"