Skip to content

compute the preflight_operators_to_certify var #79

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 39 additions & 9 deletions testpmd/hooks/pre-run.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---

- name: Create example-cnf facts
set_fact:
app_version: v0.2.6
cnf_app_networks:
- name: intel-numa0-net1
count: 2
Expand Down Expand Up @@ -40,18 +40,10 @@
executable: /bin/bash
chdir: "{{ dci_change_dir }}/example-cnf"

- name: Get app version
shell: ". {{ job_logs.path }}/versions.cfg && echo v${VERSIONS[testpmd-container-app]}"
register: app_output
args:
executable: /bin/bash
chdir: "{{ dci_change_dir }}/example-cnf"

- name: Override index and app variables
set_fact:
operator_version: "{{ index_output.stdout }}"
example_cnf_index_image: "quay.io/rh-nfv-int/nfv-example-cnf-catalog:{{ index_output.stdout }}"
app_version: "{{ app_output.stdout }}"

- name: 'Remove component from the job'
dci_job_component:
Expand All @@ -73,6 +65,40 @@
when:
- dci_change_dir is defined

- name: Create the preflight_operators_to_certify variable
when:
- certify_operators | default(false) | bool
- example_cnf_index_image is defined
block:
- name: Get Catalog Data
ansible.builtin.shell:
cmd: >
set -e -o pipefail;
~/clusterconfigs-{{ cluster_name }}/opm render
{{ example_cnf_index_image }} |
jq -r '.relatedImages[].image'
args:
executable: /bin/bash
register: catalog_data_cmd
retries: 1
delay: 5
until:
- catalog_data_cmd.rc == 0

- name: Create an empty preflight_operators_to_certify variable
ansible.builtin.set_fact:
preflight_operators_to_certify: []

- name: Populate the preflight_operators_to_certify variable
ansible.builtin.set_fact:
preflight_operators_to_certify: "{{ preflight_operators_to_certify + [dict(bundle_image=item, index_image=example_cnf_index_image)] }}"
when: '"bundle@" in item'
loop: "{{ catalog_data_cmd.stdout_lines }}"

- name: Display the prefight_operators_to_certify variable
ansible.builtin.debug:
msg: "{{ preflight_operators_to_certify }}"

- name: "Create CNF Namespace"
community.kubernetes.k8s:
state: present
Expand Down Expand Up @@ -115,6 +141,7 @@
loop_control:
loop_var: sriov
when: sriov_network is defined
tags: [sriov]

- name: Create SriovNetwork
k8s:
Expand All @@ -123,13 +150,15 @@
loop_control:
loop_var: sriov
when: sriov_network is defined
tags: [sriov]

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

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