Skip to content

Commit 48a6d1b

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 48a6d1b

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,40 @@
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+
{{ example_cnf_index_image }} |
88+
jq -r '.relatedImages[].image'
89+
args:
90+
executable: /bin/bash
91+
register: catalog_data_cmd
92+
retries: 1
93+
delay: 5
94+
until:
95+
- catalog_data_cmd.rc == 0
96+
97+
- name: Create an empty preflight_operators_to_certify variable
98+
ansible.builtin.set_fact:
99+
preflight_operators_to_certify: []
100+
101+
- name: Populate the preflight_operators_to_certify variable
102+
ansible.builtin.set_fact:
103+
preflight_operators_to_certify: "{{ preflight_operators_to_certify + [dict(bundle_image=item, index_image=example_cnf_index_image)] }}"
104+
when: '"bundle@" in item'
105+
loop: "{{ catalog_data_cmd.stdout_lines }}"
106+
107+
- name: Display the prefight_operators_to_certify variable
108+
ansible.builtin.debug:
109+
msg: "{{ preflight_operators_to_certify }}"
110+
76111
- name: "Create CNF Namespace"
77112
community.kubernetes.k8s:
78113
state: present
@@ -115,6 +150,7 @@
115150
loop_control:
116151
loop_var: sriov
117152
when: sriov_network is defined
153+
tags: [sriov]
118154

119155
- name: Create SriovNetwork
120156
k8s:
@@ -123,13 +159,15 @@
123159
loop_control:
124160
loop_var: sriov
125161
when: sriov_network is defined
162+
tags: [sriov]
126163

127164
# SR-IOV operator reports networks to be well-created,
128165
# but then it takes several minutes
129166
# to see them allocatable on the worker nodes.
130167
# OCPBUGS created in case of issues (OCP 4.12/13/14) - https://issues.redhat.com/browse/OCPBUGS-13278
131168
# Workaround included in check-resource common role in dci-openshift-agent for the moment
132169
- name: Ensure that SR-IOV networks are allocatable on the nodes
170+
tags: [sriov]
133171
block:
134172
- name: Wait to have all networks allocatable on worker nodes
135173
include_role:
@@ -160,6 +198,7 @@
160198
name: "{{ dci_config_dir }}/hooks/roles/sriov-networks"
161199

162200
- name: SR-IOV must-gather
201+
tags: [sriov]
163202
script: "{{ dci_config_dir }}/hooks/files/collect-sriov-operator-data.sh {{ oc_tool_path }} | tee {{ job_logs.path }}/collect-sriov-operator-data.txt"
164203
ignore_errors: true
165204
no_log: true

0 commit comments

Comments
 (0)