Skip to content

Commit a91df94

Browse files
compute the preflight_operators_to_certify var
1 parent 221f103 commit a91df94

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

testpmd/hooks/pre-run.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
2+
23
- name: Create example-cnf facts
34
set_fact:
45
app_version: v0.2.6
@@ -73,6 +74,44 @@
7374
when:
7475
- dci_change_dir is defined
7576

77+
- name: Create the preflight_operators_to_certify variable
78+
when:
79+
- certify_operators is defined
80+
- certify_operators | bool
81+
- example_cnf_index_image is defined
82+
block:
83+
- name: Get Catalog Data
84+
ansible.builtin.shell:
85+
cmd: >
86+
set -e -o pipefail;
87+
~/clusterconfigs-{{ cluster_name }}/opm render
88+
{% if mc_pullsecret is defined %}
89+
--authfile {{ mc_pullsecret }}
90+
{% endif %}
91+
{{ example_cnf_index_image }} |
92+
jq -r '.relatedImages[].image'
93+
args:
94+
executable: /bin/bash
95+
register: catalog_data_cmd
96+
retries: 1
97+
delay: 5
98+
until:
99+
- catalog_data_cmd.rc == 0
100+
101+
- name: Create an empty preflight_operators_to_certify variable
102+
ansible.builtin.set_fact:
103+
preflight_operators_to_certify: []
104+
105+
- name: Populate the preflight_operators_to_certify variable
106+
ansible.builtin.set_fact:
107+
preflight_operators_to_certify: "{{ preflight_operators_to_certify + [dict(bundle_image=item, index_image=example_cnf_index_image)] }}"
108+
when: '"bundle@" in item'
109+
loop: "{{ catalog_data_cmd.stdout_lines }}"
110+
111+
- name: Display the prefight_operators_to_certify variable
112+
ansible.builtin.debug:
113+
msg: "{{ preflight_operators_to_certify }}"
114+
76115
- name: "Create CNF Namespace"
77116
community.kubernetes.k8s:
78117
state: present

0 commit comments

Comments
 (0)