Skip to content

Commit 6624ebe

Browse files
compute the preflight_operators_to_certify var
- add the sriov tag to some tasks to be able to skip them
1 parent 221f103 commit 6624ebe

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

testpmd/hooks/pre-run.yml

Lines changed: 42 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
@@ -115,6 +153,7 @@
115153
loop_control:
116154
loop_var: sriov
117155
when: sriov_network is defined
156+
tags: [sriov]
118157

119158
- name: Create SriovNetwork
120159
k8s:
@@ -123,13 +162,15 @@
123162
loop_control:
124163
loop_var: sriov
125164
when: sriov_network is defined
165+
tags: [sriov]
126166

127167
# SR-IOV operator reports networks to be well-created,
128168
# but then it takes several minutes
129169
# to see them allocatable on the worker nodes.
130170
# OCPBUGS created in case of issues (OCP 4.12/13/14) - https://issues.redhat.com/browse/OCPBUGS-13278
131171
# Workaround included in check-resource common role in dci-openshift-agent for the moment
132172
- name: Ensure that SR-IOV networks are allocatable on the nodes
173+
tags: [sriov]
133174
block:
134175
- name: Wait to have all networks allocatable on worker nodes
135176
include_role:
@@ -160,6 +201,7 @@
160201
name: "{{ dci_config_dir }}/hooks/roles/sriov-networks"
161202

162203
- name: SR-IOV must-gather
204+
tags: [sriov]
163205
script: "{{ dci_config_dir }}/hooks/files/collect-sriov-operator-data.sh {{ oc_tool_path }} | tee {{ job_logs.path }}/collect-sriov-operator-data.txt"
164206
ignore_errors: true
165207
no_log: true

0 commit comments

Comments
 (0)