From 642df50f8171b5709638c407cbc552df49068f27 Mon Sep 17 00:00:00 2001 From: Victoria Martinez de la Cruz Date: Mon, 8 Jul 2024 12:42:05 +0200 Subject: [PATCH] Get opm for getting bundles information We need opm to get the bundle version when deploying from index with pre-built bundles Get opm following the same logic we use for operator-sdk --- build/get_opm.sh | 16 ++++++++++++++++ build/stf-run-ci/tasks/main.yml | 7 +++++++ 2 files changed, 23 insertions(+) create mode 100644 build/get_opm.sh diff --git a/build/get_opm.sh b/build/get_opm.sh new file mode 100644 index 00000000..01840952 --- /dev/null +++ b/build/get_opm.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -x + +REL=$(dirname "$0") +VERSION="$1" +OPM_DL_URL=https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/${VERSION} + +if [[ ! -f ${REL}/working/opm-${VERSION} ]]; then + mkdir -p ${REL}/working + curl -L ${OPM_DL_URL}/opm-linux-${VERSION}.tar.gz -o ${REL}/working/opm-${VERSION} + chmod +x ${REL}/working/opm-${VERSION} + rm -f ${REL}/working/opm-linux-${VERSION}.tar.gz +fi + +set +x \ No newline at end of file diff --git a/build/stf-run-ci/tasks/main.yml b/build/stf-run-ci/tasks/main.yml index df29982a..29c2d005 100644 --- a/build/stf-run-ci/tasks/main.yml +++ b/build/stf-run-ci/tasks/main.yml @@ -78,6 +78,13 @@ creates: "{{ base_dir }}/working/operator-sdk-{{ operator_sdk_v1 }}" chdir: "{{ base_dir }}" +- name: Get opm (deploy from index with pre-built bundles) + when: __deploy_from_bundles_enabled | bool and __deploy_from_index_enabled | bool + ansible.builtin.command: + cmd: "{{ base_dir }}/get_opm.sh {{ ocp_version }}" + creates: "{{ base_dir }}/working/opm-{{ ocp_version }}" + chdir: "{{ base_dir }}" + - name: Set logfile_dir when: not (logfile_dir is defined) ansible.builtin.set_fact: