From 7b2008536944319629203c927d7d95f718941d35 Mon Sep 17 00:00:00 2001 From: Andrii Chubatiuk Date: Tue, 24 Dec 2024 10:20:16 +0200 Subject: [PATCH] fixed-operatorhub-scripts --- .github/workflows/operatorhub.yaml | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/.github/workflows/operatorhub.yaml b/.github/workflows/operatorhub.yaml index 9e5f6225..b67a968b 100644 --- a/.github/workflows/operatorhub.yaml +++ b/.github/workflows/operatorhub.yaml @@ -77,21 +77,19 @@ jobs: else yq -i '.updateGraph = "replaces-mode"' ${OPERATOR_DIR}/ci.yaml fi - else - if [ -f ${OPERATOR_DIR}/Makefile ]; then - cd ${OPERATOR_DIR} - export NEW_ENTRY="victoriametrics-operator.v${LATEST_VERSION}" - export OLD_ENTRY="victoriametrics-operator.v${PREV_VERSION}" - export BUNDLE_IMAGE="quay.io/community-operator-pipeline-prod/victoriametrics-operator:${LATEST_VERSION}" - find catalog-templates \ - -path "*.yaml" \ - -exec yq -i -I2 '.entries |= .[] |= select(. | has("entries")).entries += [{"name": strenv(NEW_ENTRY), "replaces": strenv(OLD_ENTRY)}]' {} \; - find catalog-templates \ - -path "*.yaml" \ - -exec yq -i -I2 '.entries |= . += [{"image": strenv(BUNDLE_IMAGE), "schema": "olm.bundle"}]' {} \; - make catalogs - export VERSION=${LATEST_VERSION} - end + elif [ -f ${OPERATOR_DIR}/Makefile ]; then + cd ${OPERATOR_DIR} + export NEW_ENTRY="victoriametrics-operator.v${LATEST_VERSION}" + export OLD_ENTRY="victoriametrics-operator.v${PREV_VERSION}" + export BUNDLE_IMAGE="quay.io/community-operator-pipeline-prod/victoriametrics-operator:${LATEST_VERSION}" + find catalog-templates \ + -path "*.yaml" \ + -exec yq -i -I2 '.entries |= .[] |= select(. | has("entries")).entries += [{"name": strenv(NEW_ENTRY), "replaces": strenv(OLD_ENTRY)}]' {} \; + find catalog-templates \ + -path "*.yaml" \ + -exec yq -i -I2 '.entries |= . += [{"image": strenv(BUNDLE_IMAGE), "schema": "olm.bundle"}]' {} \; + make catalogs + export VERSION=${LATEST_VERSION} fi echo "VERSION=$VERSION" >> $GITHUB_OUTPUT