Skip to content

Commit

Permalink
Add extra logic to avoid variables overwrite
Browse files Browse the repository at this point in the history
sto_bundle_info and sgo_bundle_info is overriding
even though the step is skipped

Add an extra logic check to avoid variables
override
  • Loading branch information
vkmc committed Jul 9, 2024
1 parent 8b74361 commit f57dc99
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions build/stf-run-ci/tasks/create_catalog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,43 +8,43 @@
# Updating to use stdout_lines[-1] so that any additional info that gets added to generate_bundles (e.g. for debug) doesn't break this task
# Adding from_json so that the JSON output is parsed into a dictionary
- name: Create info variables from bundle generation output (local build)
when: __local_build_enabled | bool
when: __local_build_enabled | bool and not __deploy_from_bundles_enabled | bool
ansible.builtin.set_fact:
sto_bundle_info: "{{ generate_bundle_sto.stdout_lines[-1] | from_json }}"
sgo_bundle_info: "{{ generate_bundle_sgo.stdout_lines[-1] | from_json }}"

- name: Create info variables from provided pre-built bundles (deploy from bundles)
when: __deploy_from_bundles_enabled | bool
when: __deploy_from_bundles_enabled | bool and not __local_build_enabled | bool
block:
- name: Get STO operator bundle info
ansible.builtin.command: oc image info {{ __service_telemetry_bundle_image_path }}
register: sto_bundle_info
register: sto_prebuilt_image_info

- name: Get SGO operator bundle info
ansible.builtin.command: oc image info {{ __smart_gateway_bundle_image_path }}
register: sgo_bundle_info
register: sgo_prebuilt_image_info

- name: Get STO and SGO bundle versions
ansible.builtin.set_fact:
sto_operator_bundle_version: "{{ sto_bundle_info.stdout_lines[-1] | split('=') | last }}"
sgo_operator_bundle_version: "{{ sgo_bundle_info.stdout_lines[-1] | split('=') | last }}"
sto_prebuilt_bundle_version: "{{ sto_prebuilt_image_info.stdout_lines[-1] | split('=') | last }}"
sgo_prebuilt_bundle_version: "{{ sgo_prebuilt_image_info.stdout_lines[-1] | split('=') | last }}"

- name: Set info variables from provided pre-built bundles
ansible.builtin.set_fact:
sto_bundle_info:
'bundle_default_channel': "{{ stf_channel }}"
'bundle_channels': "{{ stf_channel }}"
'operator_bundle_version': "{{ sto_operator_bundle_version }}"
'operator_bundle_version': "{{ sto_prebuilt_bundle_version }}"
sgo_bundle_info:
'bundle_default_channel': "{{ stf_channel }}"
'bundle_channels': "{{ stf_channel }}"
'operator_bundle_version': "{{ sgo_operator_bundle_version }}"
'operator_bundle_version': "{{ sgo_prebuilt_bundle_version }}"

- name: Show STO and SGO bundle info that will used in the index image
ansible.builtin.debug:
msg:
- "{{ sto_bundle_info }}"
- "{{ sgo_bundle_info }}"
- "{{ sto_local_bundle_info }}"
- "{{ sgo_local_bundle_info }}"

- name: Create ImageStream for STO and SGO (deploying from bundles)
when: __deploy_from_bundles_enabled | bool
Expand Down

0 comments on commit f57dc99

Please sign in to comment.