diff --git a/build/stf-run-ci/tasks/create_catalog.yml b/build/stf-run-ci/tasks/create_catalog.yml index d68308d0..f5ae8cf8 100644 --- a/build/stf-run-ci/tasks/create_catalog.yml +++ b/build/stf-run-ci/tasks/create_catalog.yml @@ -16,20 +16,28 @@ - name: Create info variables from provided pre-built bundles (deploy from bundles) 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_prebuilt_image_info + - name: Get STO operator bundle CSV file + ansible.builtin.command: oc image extract {{ __service_telemetry_bundle_image_path }} --file /manifests/*clusterserviceversion.yaml - - name: Get SGO operator bundle info - ansible.builtin.command: oc image info {{ __smart_gateway_bundle_image_path }} - register: sgo_prebuilt_image_info + - name: Get SGO operator bundle CSV file + ansible.builtin.command: oc image extract {{ __smart_gateway_bundle_image_path }} --file /manifests/*clusterserviceversion.yaml - - name: Get STO and SGO bundle versions (from metadata) + - name: Read STO and SGO bundle CSV file contents ansible.builtin.set_fact: - 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 }}" + sto_prebuilt_bundle_csv: "{{ lookup('file', 'service-telemetry-operator.clusterserviceversion.yaml') | ansible.builtin.from_yaml }}" + sgo_prebuilt_bundle_csv: "{{ lookup('file', 'smart-gateway-operator.clusterserviceversion.yaml') | ansible.builtin.from_yaml }}" - - name: Get STO and SGO bundle tags (from name) + - name: Get STO and SGO bundle package names (from CSV) + ansible.builtin.set_fact: + sto_prebuilt_bundle_package_name: "{{ sto_prebuilt_bundle_csv.metadata.name }}" + sgo_prebuilt_bundle_package_name: "{{ sgo_prebuilt_bundle_csv.metadata.name }}" + + - name: Get STO and SGO bundle versions (from CSV) + ansible.builtin.set_fact: + sto_prebuilt_bundle_version: "{{ sto_prebuilt_bundle_csv.spec.version }}" + sgo_prebuilt_bundle_version: "{{ sgo_prebuilt_bundle_csv.spec.version }}" + + - name: Get STO and SGO bundle image tags (from name) ansible.builtin.set_fact: sto_prebuilt_bundle_tag: "{{ __service_telemetry_bundle_image_path | split(':') | last }}" sgo_prebuilt_bundle_tag: "{{ __smart_gateway_bundle_image_path | split(':') | last }}" @@ -37,11 +45,13 @@ - name: Set info variables from provided pre-built bundles ansible.builtin.set_fact: sto_bundle_info: + 'package_name': "{{ sto_prebuilt_bundle_package_name }}" 'bundle_default_channel': "{{ stf_channel }}" 'bundle_channels': "{{ stf_channel }}" 'operator_bundle_version': "{{ sto_prebuilt_bundle_version }}" 'operator_bundle_tag': "{{ sto_prebuilt_bundle_tag }}" sgo_bundle_info: + 'package_name': "{{ sgo_prebuilt_bundle_package_name }}" 'bundle_default_channel': "{{ stf_channel }}" 'bundle_channels': "{{ stf_channel }}" 'operator_bundle_version': "{{ sgo_prebuilt_bundle_version }}" diff --git a/build/stf-run-ci/templates/index-yaml.j2 b/build/stf-run-ci/templates/index-yaml.j2 index 54731b8f..44e22286 100644 --- a/build/stf-run-ci/templates/index-yaml.j2 +++ b/build/stf-run-ci/templates/index-yaml.j2 @@ -7,7 +7,7 @@ schema: olm.channel package: service-telemetry-operator name: {{ sto_bundle_info.bundle_channels }} entries: - - name: service-telemetry-operator.v{{ sto_bundle_info.operator_bundle_version }} + - name: {{ sto_bundle_info.package_name }} --- defaultChannel: {{ sgo_bundle_info.bundle_default_channel }} name: smart-gateway-operator @@ -17,4 +17,4 @@ schema: olm.channel package: smart-gateway-operator name: {{ sgo_bundle_info.bundle_channels }} entries: - - name: smart-gateway-operator.v{{ sgo_bundle_info.operator_bundle_version }} + - name: {{ sgo_bundle_info.package_name }}