Skip to content
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

[create_catalog] Replace fetch and include_vars with slurp #646

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
28 changes: 28 additions & 0 deletions build/stf-run-ci/tasks/create_catalog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
args:
chdir: "{{ base_dir }}/working/service-telemetry-framework-index/"

# delete from here
- name: Set the csv_dest based on whether zuul is used or not
ansible.builtin.set_fact:
csv_dest: "{{ zuul.executor.work_root if zuul is defined else base_dir + '/working/service-telemetry-framework-index/' }}"
Expand Down Expand Up @@ -67,12 +68,39 @@
ansible.builtin.set_fact:
sto_prebuilt_bundle_version: "{{ sto_prebuilt_bundle_csv.spec.version }}"
sgo_prebuilt_bundle_version: "{{ sgo_prebuilt_bundle_csv.spec.version }}"
# Delete to here

- 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 }}"

## test from here
- name: Slurp STO bundle CSV file
ansible.builtin.slurp:
src: "{{ base_dir }}/working/service-telemetry-framework-index/service-telemetry-operator.clusterserviceversion.yaml"
register: sto_file

- name: Slurp SGO bundle CSV file
ansible.builtin.slurp:
src: "{{ base_dir }}/working/service-telemetry-framework-index/smart-gateway-operator.clusterserviceversion.yaml"
register: sgo_file

- name: Set the bundle version and package name from CSV
ansible.builtin.set_fact:
slurp_sto_prebuilt_bundle_version: "{{ (sto_file.content | b64decode | from_yaml).spec.version }}"
slurp_sto_prebuilt_bundle_package_name: "{{ (sto_file.content | b64decode | from_yaml).metadata.name }}"
slurp_sgo_prebuilt_bundle_version: "{{ (sgo_file.content | b64decode | from_yaml).spec.version }}"
slurp_sgo_prebuilt_bundle_package_name: "{{ (sgo_file.content | b64decode | from_yaml).metadata.name }}"
- name: TEMP Compare slurp and fetch results
assert:
that:
- 'slurp_sto_prebuilt_bundle_version == sto_prebuilt_bundle_version'
- 'slurp_sto_prebuilt_bundle_package_name == sto_prebuilt_bundle_package_name'
- 'slurp_sgo_prebuilt_bundle_version == sgo_prebuilt_bundle_version'
- 'slurp_sgo_prebuilt_bundle_package_name == sgo_prebuilt_bundle_package_name'

## end test
- name: Set info variables from provided pre-built bundles
ansible.builtin.set_fact:
sto_bundle_info:
Expand Down
Loading