diff --git a/ci/playbooks/kuttl/deploy-deps.yaml b/ci/playbooks/kuttl/deploy-deps.yaml index 9036df409..6ff83f0fc 100644 --- a/ci/playbooks/kuttl/deploy-deps.yaml +++ b/ci/playbooks/kuttl/deploy-deps.yaml @@ -152,6 +152,16 @@ {{ zuul.projects[project_name].src_dir }} + # cifmw_zuul_target_host_env lets a job pass extra env vars (e.g. + # KUTTL_SUITE) into the operator Make targets, so the prep step + # deploys deps for the same suite that kuttl-test-run executes. + environment: >- + {{ + { + 'KUBECONFIG': cifmw_openshift_kubeconfig, + 'PATH': cifmw_path | default(ansible_env.PATH), + } | combine(cifmw_zuul_target_host_env | default({})) + }} ansible.builtin.command: cmd: make kuttl-test-prep chdir: "{{ ansible_user_dir }}/{{ operator_basedir }}" diff --git a/ci/playbooks/kuttl/run-kuttl-from-operator-targets.yaml b/ci/playbooks/kuttl/run-kuttl-from-operator-targets.yaml index 0d5e469a7..0ab89c9b8 100644 --- a/ci/playbooks/kuttl/run-kuttl-from-operator-targets.yaml +++ b/ci/playbooks/kuttl/run-kuttl-from-operator-targets.yaml @@ -14,9 +14,16 @@ name: run_hook - name: run kuttl test suite from operator Makefile - environment: - KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}" - PATH: "{{ cifmw_path | default(ansible_env.PATH) }}" + # cifmw_zuul_target_host_env lets a job pass extra env vars (e.g. + # KUTTL_SUITE) into the operator Make targets. Merge it last so a job + # can override the suite selected by the operator Makefile default. + environment: >- + {{ + { + 'KUBECONFIG': cifmw_openshift_kubeconfig, + 'PATH': cifmw_path | default(ansible_env.PATH), + } | combine(cifmw_zuul_target_host_env | default({})) + }} ansible.builtin.command: cmd: make kuttl-test-run chdir: "{{ ansible_user_dir }}/{{ operator_basedir }}"