From e1f52ddbee27a9e44609a55d43d061f243c6db76 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Mon, 16 Dec 2024 08:32:45 +0000 Subject: [PATCH] Fix helm tests (#827) (#828) This is a backport of PR #827 as merged into main (c8a33c7). SUMMARY Some of the charts we've used for testing are no longer available at the old helm repository urls, as they've been moved to oci registries. This updates those charts. In the longer term, we should find a better way to handle these kinds of test fixtures, probably by switching to local charts as much as possible. ISSUE TYPE Bugfix Pull Request Docs Pull Request Feature Pull Request New Module Pull Request COMPONENT NAME ADDITIONAL INFORMATION Reviewed-by: Bikouo Aubin --- tests/integration/targets/helm/tasks/main.yml | 2 +- .../targets/helm/tasks/test_helm_reuse_values.yml | 6 ++---- tests/integration/targets/helm/tasks/tests_chart.yml | 6 +++--- tests/integration/targets/helm_pull/tasks/main.yml | 3 +-- tests/integration/targets/helm_set_values/tasks/main.yml | 9 +++------ tests/integration/targets/install_helm/defaults/main.yml | 2 +- 6 files changed, 11 insertions(+), 17 deletions(-) diff --git a/tests/integration/targets/helm/tasks/main.yml b/tests/integration/targets/helm/tasks/main.yml index 9d8dda3e7b..79c2832031 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.7.0" + - "v3.8.0" diff --git a/tests/integration/targets/helm/tasks/test_helm_reuse_values.yml b/tests/integration/targets/helm/tasks/test_helm_reuse_values.yml index 9384fd4f4f..7801b485ea 100644 --- a/tests/integration/targets/helm/tasks/test_helm_reuse_values.yml +++ b/tests/integration/targets/helm/tasks/test_helm_reuse_values.yml @@ -17,8 +17,7 @@ - name: Initial chart installation helm: binary_path: "{{ helm_binary }}" - chart_ref: redis - chart_repo_url: https://charts.bitnami.com/bitnami + chart_ref: oci://registry-1.docker.io/bitnamicharts/redis release_name: test-redis release_namespace: "{{ helm_namespace }}" create_namespace: true @@ -42,8 +41,7 @@ - name: Upgrade chart using reuse_values=true helm: binary_path: "{{ helm_binary }}" - chart_ref: redis - chart_repo_url: https://charts.bitnami.com/bitnami + chart_ref: oci://registry-1.docker.io/bitnamicharts/redis release_name: test-redis release_namespace: "{{ helm_namespace }}" reuse_values: true diff --git a/tests/integration/targets/helm/tasks/tests_chart.yml b/tests/integration/targets/helm/tasks/tests_chart.yml index ff1c427a86..fda5bf85c2 100644 --- a/tests/integration/targets/helm/tasks/tests_chart.yml +++ b/tests/integration/targets/helm/tasks/tests_chart.yml @@ -374,8 +374,8 @@ chart_ref: "{{ chart_source }}" chart_version: "{{ chart_source_version | default(omit) }}" disable_hook: True - release_name: "MyRelease" - release_namespace: "MyReleaseNamespace" + release_name: "myrelease" + release_namespace: "myreleasenamespace" show_only: - "templates/configmap.yaml" release_values: @@ -388,7 +388,7 @@ - result is changed - result is not failed - result.rc == 0 - - result.command is match(helm_binary+" template MyRelease "+chart_source) + - result.command is match(helm_binary+" template myrelease "+chart_source) - result.stdout is search("ThisValue") when: chart_source is search("test-chart") # limit assertion of test result to controlled (local) chart_source diff --git a/tests/integration/targets/helm_pull/tasks/main.yml b/tests/integration/targets/helm_pull/tasks/main.yml index 3705c5cb1c..1faf2be35c 100644 --- a/tests/integration/targets/helm_pull/tasks/main.yml +++ b/tests/integration/targets/helm_pull/tasks/main.yml @@ -203,9 +203,8 @@ - name: Download chart using untar_chart helm_pull: binary_path: "{{ helm_path }}" - chart_ref: redis + chart_ref: "oci://registry-1.docker.io/bitnamicharts/redis" destination: "{{ destination }}" - repo_url: "https://charts.bitnami.com/bitnami" untar_chart: true register: _result diff --git a/tests/integration/targets/helm_set_values/tasks/main.yml b/tests/integration/targets/helm_set_values/tasks/main.yml index 7ce5125f8d..f18428180e 100644 --- a/tests/integration/targets/helm_set_values/tasks/main.yml +++ b/tests/integration/targets/helm_set_values/tasks/main.yml @@ -1,8 +1,7 @@ - name: Install helm using set_values parameters helm: binary_path: "{{ helm_binary }}" - chart_ref: mariadb - chart_repo_url: https://charts.bitnami.com/bitnami + chart_ref: oci://registry-1.docker.io/bitnamicharts/mariadb release_name: test-mariadb release_namespace: "{{ helm_namespace }}" create_namespace: true @@ -36,8 +35,7 @@ - name: Install helm using set_values parameters helm: binary_path: "{{ helm_binary }}" - chart_ref: apache - chart_repo_url: https://charts.bitnami.com/bitnami + chart_ref: oci://registry-1.docker.io/bitnamicharts/apache release_name: test-apache release_namespace: "{{ helm_namespace }}" create_namespace: true @@ -79,8 +77,7 @@ - name: Install helm using set_values parameters helm: binary_path: "{{ helm_binary }}" - chart_ref: minio - chart_repo_url: https://charts.bitnami.com/bitnami + chart_ref: oci://registry-1.docker.io/bitnamicharts/minio release_name: test-minio release_namespace: "{{ helm_namespace }}" create_namespace: true diff --git a/tests/integration/targets/install_helm/defaults/main.yml b/tests/integration/targets/install_helm/defaults/main.yml index 0f8c952f49..6161efb680 100644 --- a/tests/integration/targets/install_helm/defaults/main.yml +++ b/tests/integration/targets/install_helm/defaults/main.yml @@ -1,4 +1,4 @@ --- -helm_version: v3.7.0 +helm_version: v3.8.0 helm_install_path: /tmp/helm helm_default_archive_name: "helm-{{ helm_version }}-{{ ansible_system | lower }}-amd64.tar.gz"