From 794cc446fb242b0fa652a7393ee3c7b43f64dae5 Mon Sep 17 00:00:00 2001 From: Luigi Toscano Date: Mon, 25 Nov 2024 17:34:36 +0100 Subject: [PATCH] kuttl: fetch the locally built operators Make sure that locally built operator (for example, thanks to the openstack-k8s-operators-content-provider job, or anything else which populates cifmw_operator_build_output) are used. This is a bit more complex than what EDPM jobs do (see the edpm_prepare role), where only the openstack-operator-index is overridden, likely because here there may be more operators being built. --- ci/playbooks/kuttl/run-kuttl-tests.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/ci/playbooks/kuttl/run-kuttl-tests.yml b/ci/playbooks/kuttl/run-kuttl-tests.yml index 62f7107203..97f781b622 100644 --- a/ci/playbooks/kuttl/run-kuttl-tests.yml +++ b/ci/playbooks/kuttl/run-kuttl-tests.yml @@ -3,11 +3,23 @@ ansible.builtin.include_vars: dir: "{{ cifmw_basedir }}/artifacts/parameters" +- name: Use the locally built operators if any + ansible.builtin.set_fact: + _local_operators_indexes: + "{{ _local_operators_indexes|default({}) | + combine({ item.key.split('-')[0]|upper+'_IMG': + cifmw_operator_build_output['operators'][item.key].image_catalog}) }}" + loop: "{{ cifmw_operator_build_output['operators'] | dict2items }}" + when: + - cifmw_operator_build_output is defined + - "'operators' in cifmw_operator_build_output" + - name: Set environment vars for kuttl test ansible.builtin.set_fact: cifmw_kuttl_tests_env: >- {{ - cifmw_install_yamls_environment | + _local_operators_indexes | default({}) | + combine(cifmw_install_yamls_environment) | combine(cifmw_kuttl_tests_env_vars | default({})) | combine(cifmw_kuttl_openstack_prep_vars | default({})) | combine({'PATH': cifmw_path})