From e9d8515d0935eab94265a59216fd14fb8a130df6 Mon Sep 17 00:00:00 2001 From: Eguzki Astiz Lezaun Date: Fri, 27 Sep 2024 11:28:29 +0200 Subject: [PATCH] remove replaces from bundle Signed-off-by: Eguzki Astiz Lezaun --- .github/workflows/build-images-base.yaml | 10 ---------- Makefile | 6 ------ .../limitador-operator.clusterserviceversion.yaml | 1 - .../limitador-operator.clusterserviceversion.yaml | 1 - doc/development.md | 5 +---- make/catalog.mk | 3 +-- utils/generate-catalog.sh | 7 ++----- 7 files changed, 4 insertions(+), 29 deletions(-) diff --git a/.github/workflows/build-images-base.yaml b/.github/workflows/build-images-base.yaml index 4a38d818..6b257878 100644 --- a/.github/workflows/build-images-base.yaml +++ b/.github/workflows/build-images-base.yaml @@ -15,10 +15,6 @@ on: description: Limitador version default: latest type: string - replacesVersion: - description: Limitador Operator replaced version - default: 0.0.0-alpha - type: string channels: description: Bundle and catalog channels, comma separated default: preview @@ -45,10 +41,6 @@ on: description: Limitador version default: latest type: string - replacesVersion: - description: Limitador Operator replaced version - default: 0.0.0-alpha - type: string channels: description: Bundle and catalog channels, comma separated default: preview @@ -138,7 +130,6 @@ jobs: VERSION=${{ env.VERSION }} \ IMAGE_TAG=${{ inputs.operatorTag }} \ LIMITADOR_VERSION=${{ inputs.limitadorVersion }} \ - REPLACES_VERSION=${{ inputs.replacesVersion }} \ DEFAULT_CHANNEL=${{ inputs.defaultChannel }} \ CHANNELS=${{ inputs.channels }} - name: Add git sha tag for the main branch @@ -188,7 +179,6 @@ jobs: REGISTRY=${{ env.IMG_REGISTRY_HOST }} ORG=${{ env.IMG_REGISTRY_ORG }} \ VERSION=${{ env.VERSION }} IMAGE_TAG=${{ inputs.operatorTag }} \ LIMITADOR_VERSION=${{ inputs.limitadorVersion }} \ - REPLACES_VERSION=${{ inputs.replacesVersion }} \ DEFAULT_CHANNEL=${{ inputs.defaultChannel }} - name: Install qemu dependency run: | diff --git a/Makefile b/Makefile index 152ef862..aca43e4d 100644 --- a/Makefile +++ b/Makefile @@ -88,10 +88,6 @@ INTEGRATION_COVER_PKGS := ./pkg/...,./controllers/...,./api/... INTEGRATION_TEST_NUM_CORES ?= 4 INTEGRATION_TEST_NUM_PROCESSES ?= 10 -# Limitador Operator replaced version -DEFAULT_REPLACES_VERSION = 0.0.0-alpha -REPLACES_VERSION ?= $(DEFAULT_REPLACES_VERSION) - # Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set) ifeq (,$(shell go env GOBIN)) GOBIN=$(shell go env GOPATH)/bin @@ -337,7 +333,6 @@ bundle: $(KUSTOMIZE) $(OPERATOR_SDK) $(YQ) manifests ## Generate bundle manifest V="limitador-operator.v$(BUNDLE_VERSION)" $(YQ) eval '.metadata.name = strenv(V)' -i config/manifests/bases/limitador-operator.clusterserviceversion.yaml V="$(BUNDLE_VERSION)" $(YQ) eval '.spec.version = strenv(V)' -i config/manifests/bases/limitador-operator.clusterserviceversion.yaml V="$(IMG)" $(YQ) eval '.metadata.annotations.containerImage = strenv(V)' -i config/manifests/bases/limitador-operator.clusterserviceversion.yaml - V="limitador-operator.v$(REPLACES_VERSION)" $(YQ) eval '.spec.replaces = strenv(V)' -i config/manifests/bases/limitador-operator.clusterserviceversion.yaml # Generate bundle $(KUSTOMIZE) build config/manifests | $(OPERATOR_SDK) generate bundle -q --overwrite --version $(BUNDLE_VERSION) $(BUNDLE_METADATA_OPTS) # Validate bundle manifests @@ -368,7 +363,6 @@ bundle-push: ## Push the bundle image. prepare-release: ## Prepare the manifests for OLM and Helm Chart for a release. $(MAKE) bundle VERSION=$(VERSION) \ LIMITADOR_VERSION=$(LIMITADOR_VERSION) \ - REPLACES_VERSION=$(REPLACES_VERSION) $(MAKE) helm-build VERSION=$(VERSION) \ LIMITADOR_VERSION=$(LIMITADOR_VERSION) diff --git a/bundle/manifests/limitador-operator.clusterserviceversion.yaml b/bundle/manifests/limitador-operator.clusterserviceversion.yaml index fec73e00..5671cc29 100644 --- a/bundle/manifests/limitador-operator.clusterserviceversion.yaml +++ b/bundle/manifests/limitador-operator.clusterserviceversion.yaml @@ -242,5 +242,4 @@ spec: relatedImages: - image: quay.io/kuadrant/limitador:latest name: limitador - replaces: limitador-operator.v0.0.0-alpha version: 0.0.0 diff --git a/config/manifests/bases/limitador-operator.clusterserviceversion.yaml b/config/manifests/bases/limitador-operator.clusterserviceversion.yaml index d39f1296..4dc408d5 100644 --- a/config/manifests/bases/limitador-operator.clusterserviceversion.yaml +++ b/config/manifests/bases/limitador-operator.clusterserviceversion.yaml @@ -53,5 +53,4 @@ spec: provider: name: Red Hat url: https://github.com/Kuadrant/limitador-operator - replaces: limitador-operator.v0.0.0-alpha version: 0.0.0 diff --git a/doc/development.md b/doc/development.md index 233a3aeb..10772d9a 100644 --- a/doc/development.md +++ b/doc/development.md @@ -123,13 +123,10 @@ The `make catalog` target accepts the following variables: | **Makefile Variable** | **Description** | **Default value** | |-----------------------|---------------------------|-----------------------------------------------------| | `BUNDLE_IMG` | Operator bundle image URL | `quay.io/kuadrant/limitador-operator-bundle:latest` | -| `REPLACES_VERSION` | Previous operator version | `0.0.0-alpha` | | `DEFAULT_CHANNEL` | Catalog default channel | `alpha` | ```sh -make catalog [BUNDLE_IMG=quay.io/kuadrant/limitador-operator-bundle:latest] \ - [REPLACES_VERSION=0.0.0-alpha] \ - [DEFAULT_CHANNEL=alpha] +make catalog [BUNDLE_IMG=quay.io/kuadrant/limitador-operator-bundle:latest] [DEFAULT_CHANNEL=alpha] ``` * Build the catalog image from the manifests diff --git a/make/catalog.mk b/make/catalog.mk index 6958f181..7a43ccac 100644 --- a/make/catalog.mk +++ b/make/catalog.mk @@ -28,13 +28,12 @@ $(CATALOG_FILE): $(OPM) $(YQ) @echo Build limitador operator catalog @echo @echo BUNDLE_IMG = $(BUNDLE_IMG) - @echo REPLACES_VERSION = $(REPLACES_VERSION) @echo CHANNEL = $(DEFAULT_CHANNEL) @echo "************************************************************" @echo @echo Please check this matches your expectations and override variables if needed. @echo - $(PROJECT_PATH)/utils/generate-catalog.sh $(OPM) $(YQ) $(BUNDLE_IMG) $@ $(REPLACES_VERSION) $(DEFAULT_CHANNEL) + $(PROJECT_PATH)/utils/generate-catalog.sh $(OPM) $(YQ) $(BUNDLE_IMG) $@ $(DEFAULT_CHANNEL) .PHONY: catalog catalog: $(OPM) ## Generate catalog content and validate. diff --git a/utils/generate-catalog.sh b/utils/generate-catalog.sh index 4715b0f0..f4a75fbc 100755 --- a/utils/generate-catalog.sh +++ b/utils/generate-catalog.sh @@ -7,15 +7,13 @@ set -euo pipefail ### CONSTANTS # Used as well in the subscription object DEFAULT_CHANNEL=preview -DEFAULT_REPLACES_VERSION=0.0.0-alpha ### OPM="${1?:Error \$OPM not set. Bye}" YQ="${2?:Error \$YQ not set. Bye}" BUNDLE_IMG="${3?:Error \$BUNDLE_IMG not set. Bye}" CATALOG_FILE="${4?:Error \$CATALOG_FILE not set. Bye}" -REPLACES_VERSION="${5:-$DEFAULT_REPLACES_VERSION}" -CHANNEL="${6:-$DEFAULT_CHANNEL}" +CHANNEL="${5:-$DEFAULT_CHANNEL}" CATALOG_FILE_BASEDIR="$( cd "$( dirname "$(realpath ${CATALOG_FILE})" )" && pwd )" CATALOG_BASEDIR="$( cd "$( dirname "$(realpath ${CATALOG_FILE_BASEDIR})" )" && pwd )" @@ -36,8 +34,7 @@ ${OPM} init limitador-operator --default-channel=${CHANNEL} --output yaml >> ${C cat ${TMP_DIR}/limitador-operator-bundle.yaml >> ${CATALOG_FILE} # Add a channel entry for the bundle V=`${YQ} eval '.name' ${TMP_DIR}/limitador-operator-bundle.yaml` \ -REPLACES=limitador-operator.v${REPLACES_VERSION} \ CHANNEL=${CHANNEL} \ - ${YQ} eval '(.entries[0].name = strenv(V)) | (.entries[0].replaces = strenv(REPLACES)) | (.name = strenv(CHANNEL))' ${CATALOG_BASEDIR}/limitador-operator-channel-entry.yaml >> ${CATALOG_FILE} + ${YQ} eval '(.entries[0].name = strenv(V)) | (.name = strenv(CHANNEL))' ${CATALOG_BASEDIR}/limitador-operator-channel-entry.yaml >> ${CATALOG_FILE} rm -rf $TMP_DIR