diff --git a/.github/workflows/build-images.yaml b/.github/workflows/build-images.yaml index c6b5493..4d99c1b 100644 --- a/.github/workflows/build-images.yaml +++ b/.github/workflows/build-images.yaml @@ -204,7 +204,8 @@ jobs: VERSION=${{ env.VERSION }} \ IMAGE_TAG=${{ github.sha }} \ AUTHORINO_VERSION=${{ env.LATEST_AUTHORINO_GITREF }} \ - CHANNELS=${{ inputs.channels }} + CHANNELS=${{ inputs.channels }} \ + OPM_DOCKERFILE_TAG=latest - name: Run make catalog (release) if: ${{ github.ref_name != env.MAIN_BRANCH_NAME }} run: | @@ -212,7 +213,8 @@ jobs: REGISTRY=${{ env.IMG_REGISTRY_HOST }} ORG=${{ env.IMG_REGISTRY_ORG }} \ VERSION=${{ env.VERSION }} \ AUTHORINO_VERSION=${{ github.event.inputs.authorinoVersion }} \ - CHANNELS=${{ inputs.channels }} + CHANNELS=${{ inputs.channels }} \ + OPM_DOCKERFILE_TAG=latest - name: Git diff run: git diff - name: Build Image @@ -288,7 +290,7 @@ jobs: IMAGE_TAG=${{ github.sha }} \ AUTHORINO_VERSION=${{ env.LATEST_AUTHORINO_GITREF }} \ CHANNELS=${{ inputs.channels }} \ - CATALOG_ARCH=${{ matrix.arch }} + ARCH=${{ matrix.arch }} - name: Run make catalog (release) if: ${{ github.ref_name != env.MAIN_BRANCH_NAME }} run: | @@ -297,7 +299,7 @@ jobs: VERSION=${{ env.VERSION }} \ AUTHORINO_VERSION=${{ github.event.inputs.authorinoVersion }} \ CHANNELS=${{ inputs.channels }} \ - CATALOG_ARCH=${{ matrix.arch }} + ARCH=${{ matrix.arch }} - name: Git diff run: git diff - name: Build Image diff --git a/Makefile b/Makefile index 94f30a2..6b8a972 100644 --- a/Makefile +++ b/Makefile @@ -138,14 +138,15 @@ $(YQ): .PHONY: yq yq: $(YQ) ## Download yq locally if necessary. +ARCH ?= $(shell go env GOARCH) OPM = $(PROJECT_DIR)/bin/opm -OPM_VERSION = v1.26.2 +OPM_VERSION ?= 1.48.0 $(OPM): @{ \ set -e ;\ mkdir -p $(dir $(OPM)) ;\ - OS=$(shell go env GOOS) && ARCH=$(shell go env GOARCH) && \ - curl -sSLo $(OPM) https://github.com/operator-framework/operator-registry/releases/download/$(OPM_VERSION)/$${OS}-$${ARCH}-opm ;\ + OS=$(shell go env GOOS) && \ + curl -sSLo $(OPM) https://github.com/operator-framework/operator-registry/releases/download/v$(OPM_VERSION)/$${OS}-$(ARCH)-opm ;\ chmod +x $(OPM) ;\ } diff --git a/make/catalog.mk b/make/catalog.mk index db28e55..54808db 100644 --- a/make/catalog.mk +++ b/make/catalog.mk @@ -3,20 +3,13 @@ # The image tag given to the resulting catalog image (e.g. make catalog-build CATALOG_IMG=example.com/operator-catalog:v0.2.0). CATALOG_IMG ?= $(IMAGE_TAG_BASE)-catalog:$(IMAGE_TAG) -OPM_DOCKERFILE_VERSION ?= 1.28.0 - -ifeq ($(origin CATALOG_ARCH),undefined) -OPM_DOCKERFILE_TAG = latest -else -OPM_DOCKERFILE_TAG = v$(OPM_DOCKERFILE_VERSION)-$(CATALOG_ARCH) -endif - CATALOG_FILE = $(PROJECT_DIR)/catalog/authorino-operator-catalog/operator.yaml CATALOG_DOCKERFILE = $(PROJECT_DIR)/catalog/authorino-operator-catalog.Dockerfile +OPM_DOCKERFILE_TAG ?= v$(OPM_VERSION)-$(ARCH) $(CATALOG_DOCKERFILE): $(OPM) -mkdir -p $(PROJECT_DIR)/catalog/authorino-operator-catalog - cd $(PROJECT_DIR)/catalog && $(OPM) generate dockerfile authorino-operator-catalog -i "quay.io/operator-framework/opm:${OPM_DOCKERFILE_TAG}" + cd $(PROJECT_DIR)/catalog && $(OPM) generate dockerfile authorino-operator-catalog -b "quay.io/operator-framework/opm:${OPM_DOCKERFILE_TAG}" -i "quay.io/operator-framework/opm:${OPM_DOCKERFILE_TAG}" catalog-dockerfile: $(CATALOG_DOCKERFILE) ## Generate catalog dockerfile. $(CATALOG_FILE): $(OPM) $(YQ)