diff --git a/tests/integration/targets/helm_diff/tasks/main.yml b/tests/integration/targets/helm_diff/tasks/main.yml index a1f1f813..94ca81fd 100644 --- a/tests/integration/targets/helm_diff/tasks/main.yml +++ b/tests/integration/targets/helm_diff/tasks/main.yml @@ -239,6 +239,7 @@ vars: chart_local_path: '{{ _tmpd.path }}/test-chart-deployment-time' chart_repo_path: 'testing' + helm_binary_path: "{{ helm_binary }}" always: - name: Delete temporary directory ansible.builtin.file: diff --git a/tests/integration/targets/helm_registry_auth/defaults/main.yaml b/tests/integration/targets/helm_registry_auth/defaults/main.yaml index da3f3368..98a8b827 100644 --- a/tests/integration/targets/helm_registry_auth/defaults/main.yaml +++ b/tests/integration/targets/helm_registry_auth/defaults/main.yaml @@ -4,6 +4,9 @@ username: testuser password: testpassword wrong_password: 'WrongPassword' +# Use the helm binary installed by the install_helm role rather than the one +# shipped with the CI image, whose version is outside of our control. +helm_binary: "/tmp/helm/{{ ansible_system | lower }}-amd64/helm" registry_name: oci_registry registry_port: 5000 test_chart: https://github.com/grafana/helm-charts/releases/download/k8s-monitoring-1.6.8/k8s-monitoring-1.6.8.tgz diff --git a/tests/integration/targets/helm_registry_auth/tasks/main.yaml b/tests/integration/targets/helm_registry_auth/tasks/main.yaml index 8e15452c..9da716d2 100644 --- a/tests/integration/targets/helm_registry_auth/tasks/main.yaml +++ b/tests/integration/targets/helm_registry_auth/tasks/main.yaml @@ -4,7 +4,7 @@ # and it allow to not install any additional dependencies block: - name: Ensure that helm is installed - ansible.builtin.shell: helm version --client --short | grep v3 + ansible.builtin.shell: "{{ helm_binary }} version --client --short | grep v3" register: _helm_version failed_when: _helm_version.rc != 0 @@ -44,14 +44,14 @@ - name: Test the registry with correct credentials to ensure that the registry is running ansible.builtin.shell: >- - echo {{ password | quote }} | helm registry login localhost:{{ registry_port }} + echo {{ password | quote }} | {{ helm_binary }} registry login localhost:{{ registry_port }} -u {{ username }} --password-stdin register: _login_correct failed_when: _login_correct.rc != 0 - name: Clean up credentials to run test on clean environment ansible.builtin.shell: >- - helm registry logout localhost:{{ registry_port }} + {{ helm_binary }} registry logout localhost:{{ registry_port }} register: _logout failed_when: _logout.rc != 0 @@ -70,6 +70,7 @@ - name: Test module helm_registry_auth with correct credentials helm_registry_auth: + binary_path: "{{ helm_binary }}" username: "{{ username }}" password: "{{ password }}" host: localhost:{{ registry_port }} @@ -87,7 +88,7 @@ - name: Ensure that push to the registry is working ansible.builtin.shell: >- - helm push "{{ _destination.path }}/k8s-monitoring-1.6.8.tgz" oci://localhost:{{ registry_port }}/test/ + {{ helm_binary }} push "{{ _destination.path }}/k8s-monitoring-1.6.8.tgz" oci://localhost:{{ registry_port }}/test/ register: _save_chart failed_when: _save_chart.rc != 0 @@ -99,6 +100,7 @@ - name: Test logout helm_registry_auth: + binary_path: "{{ helm_binary }}" host: localhost:{{ registry_port }} state: absent register: _helm_registry_auth_logout @@ -114,6 +116,7 @@ - name: Test logout idempotency helm_registry_auth: + binary_path: "{{ helm_binary }}" host: localhost:{{ registry_port }} state: absent register: _helm_registry_auth_logout_idempotency @@ -124,7 +127,7 @@ - name: Ensure that not able to push to the registry ansible.builtin.shell: >- - helm push "{{ _destination.path }}/k8s-monitoring-1.6.8.tgz" oci://localhost:{{ registry_port }}/test/ + {{ helm_binary }} push "{{ _destination.path }}/k8s-monitoring-1.6.8.tgz" oci://localhost:{{ registry_port }}/test/ register: _save_chart failed_when: _save_chart.rc == 0 @@ -143,6 +146,7 @@ - name: Test module helm_registry_auth with wrong credentials helm_registry_auth: + binary_path: "{{ helm_binary }}" username: "{{ username }}" password: "{{ wrong_password }}" host: localhost:{{ registry_port }}