You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by pc...@apache.org on 2022/04/18 09:18:04 UTC

[camel-k] 01/12: fix(e2e): Migrate to OLM file-based catalog format

This is an automated email from the ASF dual-hosted git repository.

pcongiusti pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 5cea47fa335096477446f7a45aff6484874b4bb3
Author: Antonin Stefanutti <an...@stefanutti.fr>
AuthorDate: Tue Feb 1 18:31:14 2022 +0100

    fix(e2e): Migrate to OLM file-based catalog format
---
 .github/actions/kamel-build-bundle/action.yaml     |  2 +-
 .../kamel-build-bundle/build-index-image.sh        | 26 ++++++++++++----------
 2 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/.github/actions/kamel-build-bundle/action.yaml b/.github/actions/kamel-build-bundle/action.yaml
index b52ccf88e..cba7333b3 100644
--- a/.github/actions/kamel-build-bundle/action.yaml
+++ b/.github/actions/kamel-build-bundle/action.yaml
@@ -60,7 +60,7 @@ runs:
       run: |
         if ! command -v opm &> /dev/null
         then
-          curl -L https://github.com/operator-framework/operator-registry/releases/download/v1.16.1/linux-amd64-opm -o opm
+          curl -L https://github.com/operator-framework/operator-registry/releases/download/v1.19.5/linux-amd64-opm -o opm
           chmod +x opm
           sudo mv opm /usr/local/bin/
         fi
diff --git a/.github/actions/kamel-build-bundle/build-index-image.sh b/.github/actions/kamel-build-bundle/build-index-image.sh
index e3f1d8bf7..e708e6581 100755
--- a/.github/actions/kamel-build-bundle/build-index-image.sh
+++ b/.github/actions/kamel-build-bundle/build-index-image.sh
@@ -155,18 +155,20 @@ fi
 
 #
 # Construct an index image containing the newly built bundle image
-#   Bug:
-#     https://github.com/operator-framework/operator-registry/issues/870
-#   Workaround:
-#     image catalog layers contain root owned files so fails with `permission denied` error.
-#     Running with sudo fixes this error (alternative is to switch to podman)
-#
-sudo opm index add \
-  -c docker --skip-tls \
-  --bundles ${BUNDLE_IMAGE} \
-  --from-index quay.io/operatorhubio/catalog:latest \
-  --tag ${LOCAL_IIB}
-
+mkdir catalog
+opm render quay.io/operatorhubio/catalog:latest -o yaml > catalog/bundles.yaml
+sudo opm render --skip-tls ${BUNDLE_IMAGE} > catalog/camel-k.yaml
+cat << EOF >> catalog/camel-k.yaml
+---
+schema: olm.channel
+package: camel-k
+name: stable-$(make get-version | grep -Po "\d.\d")
+entries:
+  - name: camel-k.v$(make get-version | grep -Po "\d.\d.\d")
+EOF
+opm validate catalog
+opm alpha generate dockerfile catalog
+docker build . -f catalog.Dockerfile -t ${LOCAL_IIB}
 docker push ${LOCAL_IIB}
 BUILD_BUNDLE_LOCAL_IMAGE_BUNDLE_INDEX="${REGISTRY_PULL_HOST}/${IMAGE_NAMESPACE}/camel-k-iib:${IMAGE_VERSION}"
 echo "Setting build-bundle-image-bundle-index to ${BUILD_BUNDLE_LOCAL_IMAGE_BUNDLE_INDEX}"