Skip to content

Commit 2c07fcc

Browse files
compute the preflight_operators_to_certify var
1 parent 221f103 commit 2c07fcc

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

testpmd/hooks/pre-run.yml

Lines changed: 38 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,43 @@
7374
when:
7475
- dci_change_dir is defined
7576

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

0 commit comments

Comments
 (0)