Skip to content

Commit 507de57

Browse files
authored
Merge pull request #161 from Kuadrant/remove-replaces-from-bundle
🔥 "replaces" from bundle
2 parents 641345e + 1457dbc commit 507de57

File tree

8 files changed

+4
-34
lines changed

8 files changed

+4
-34
lines changed

.github/workflows/build-images-base.yaml

-10
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ on:
1515
description: Limitador version
1616
default: latest
1717
type: string
18-
replacesVersion:
19-
description: Limitador Operator replaced version
20-
default: 0.0.0-alpha
21-
type: string
2218
channels:
2319
description: Bundle and catalog channels, comma separated
2420
default: preview
@@ -45,10 +41,6 @@ on:
4541
description: Limitador version
4642
default: latest
4743
type: string
48-
replacesVersion:
49-
description: Limitador Operator replaced version
50-
default: 0.0.0-alpha
51-
type: string
5244
channels:
5345
description: Bundle and catalog channels, comma separated
5446
default: preview
@@ -138,7 +130,6 @@ jobs:
138130
VERSION=${{ env.VERSION }} \
139131
IMAGE_TAG=${{ inputs.operatorTag }} \
140132
LIMITADOR_VERSION=${{ inputs.limitadorVersion }} \
141-
REPLACES_VERSION=${{ inputs.replacesVersion }} \
142133
DEFAULT_CHANNEL=${{ inputs.defaultChannel }} \
143134
CHANNELS=${{ inputs.channels }}
144135
- name: Add git sha tag for the main branch
@@ -188,7 +179,6 @@ jobs:
188179
REGISTRY=${{ env.IMG_REGISTRY_HOST }} ORG=${{ env.IMG_REGISTRY_ORG }} \
189180
VERSION=${{ env.VERSION }} IMAGE_TAG=${{ inputs.operatorTag }} \
190181
LIMITADOR_VERSION=${{ inputs.limitadorVersion }} \
191-
REPLACES_VERSION=${{ inputs.replacesVersion }} \
192182
DEFAULT_CHANNEL=${{ inputs.defaultChannel }}
193183
- name: Install qemu dependency
194184
run: |

.github/workflows/release.yaml

-5
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ on:
1414
description: Limitador service version
1515
default: latest
1616
type: string
17-
replacesVersion:
18-
description: Limitador Operator replaced version
19-
default: 0.0.0-alpha
20-
type: string
2117
prerelease:
2218
description: Is the release a pre release?
2319
required: false
@@ -49,7 +45,6 @@ jobs:
4945
run: |
5046
VERSION=${{ inputs.limitadorOperatorVersion }} \
5147
LIMITADOR_VERSION=${{ inputs.limitadorVersion }} \
52-
REPLACES_VERSION=${{ inputs.replacesVersion }}
5348
make prepare-release
5449
- name: Commit and push
5550
run: |

Makefile

-6
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,6 @@ INTEGRATION_COVER_PKGS := ./pkg/...,./controllers/...,./api/...
8888
INTEGRATION_TEST_NUM_CORES ?= 4
8989
INTEGRATION_TEST_NUM_PROCESSES ?= 10
9090

91-
# Limitador Operator replaced version
92-
DEFAULT_REPLACES_VERSION = 0.0.0-alpha
93-
REPLACES_VERSION ?= $(DEFAULT_REPLACES_VERSION)
94-
9591
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
9692
ifeq (,$(shell go env GOBIN))
9793
GOBIN=$(shell go env GOPATH)/bin
@@ -337,7 +333,6 @@ bundle: $(KUSTOMIZE) $(OPERATOR_SDK) $(YQ) manifests ## Generate bundle manifest
337333
V="limitador-operator.v$(BUNDLE_VERSION)" $(YQ) eval '.metadata.name = strenv(V)' -i config/manifests/bases/limitador-operator.clusterserviceversion.yaml
338334
V="$(BUNDLE_VERSION)" $(YQ) eval '.spec.version = strenv(V)' -i config/manifests/bases/limitador-operator.clusterserviceversion.yaml
339335
V="$(IMG)" $(YQ) eval '.metadata.annotations.containerImage = strenv(V)' -i config/manifests/bases/limitador-operator.clusterserviceversion.yaml
340-
V="limitador-operator.v$(REPLACES_VERSION)" $(YQ) eval '.spec.replaces = strenv(V)' -i config/manifests/bases/limitador-operator.clusterserviceversion.yaml
341336
# Generate bundle
342337
$(KUSTOMIZE) build config/manifests | $(OPERATOR_SDK) generate bundle -q --overwrite --version $(BUNDLE_VERSION) $(BUNDLE_METADATA_OPTS)
343338
# Validate bundle manifests
@@ -368,7 +363,6 @@ bundle-push: ## Push the bundle image.
368363
prepare-release: ## Prepare the manifests for OLM and Helm Chart for a release.
369364
$(MAKE) bundle VERSION=$(VERSION) \
370365
LIMITADOR_VERSION=$(LIMITADOR_VERSION) \
371-
REPLACES_VERSION=$(REPLACES_VERSION)
372366
$(MAKE) helm-build VERSION=$(VERSION) \
373367
LIMITADOR_VERSION=$(LIMITADOR_VERSION)
374368

bundle/manifests/limitador-operator.clusterserviceversion.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -242,5 +242,4 @@ spec:
242242
relatedImages:
243243
- image: quay.io/kuadrant/limitador:latest
244244
name: limitador
245-
replaces: limitador-operator.v0.0.0-alpha
246245
version: 0.0.0

config/manifests/bases/limitador-operator.clusterserviceversion.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,4 @@ spec:
5353
provider:
5454
name: Red Hat
5555
url: https://github.com/Kuadrant/limitador-operator
56-
replaces: limitador-operator.v0.0.0-alpha
5756
version: 0.0.0

doc/development.md

+1-4
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,10 @@ The `make catalog` target accepts the following variables:
123123
| **Makefile Variable** | **Description** | **Default value** |
124124
|-----------------------|---------------------------|-----------------------------------------------------|
125125
| `BUNDLE_IMG` | Operator bundle image URL | `quay.io/kuadrant/limitador-operator-bundle:latest` |
126-
| `REPLACES_VERSION` | Previous operator version | `0.0.0-alpha` |
127126
| `DEFAULT_CHANNEL` | Catalog default channel | `alpha` |
128127

129128
```sh
130-
make catalog [BUNDLE_IMG=quay.io/kuadrant/limitador-operator-bundle:latest] \
131-
[REPLACES_VERSION=0.0.0-alpha] \
132-
[DEFAULT_CHANNEL=alpha]
129+
make catalog [BUNDLE_IMG=quay.io/kuadrant/limitador-operator-bundle:latest] [DEFAULT_CHANNEL=alpha]
133130
```
134131

135132
* Build the catalog image from the manifests

make/catalog.mk

+1-2
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,12 @@ $(CATALOG_FILE): $(OPM) $(YQ)
2828
@echo Build limitador operator catalog
2929
@echo
3030
@echo BUNDLE_IMG = $(BUNDLE_IMG)
31-
@echo REPLACES_VERSION = $(REPLACES_VERSION)
3231
@echo CHANNEL = $(DEFAULT_CHANNEL)
3332
@echo "************************************************************"
3433
@echo
3534
@echo Please check this matches your expectations and override variables if needed.
3635
@echo
37-
$(PROJECT_PATH)/utils/generate-catalog.sh $(OPM) $(YQ) $(BUNDLE_IMG) $@ $(REPLACES_VERSION) $(DEFAULT_CHANNEL)
36+
$(PROJECT_PATH)/utils/generate-catalog.sh $(OPM) $(YQ) $(BUNDLE_IMG) $@ $(DEFAULT_CHANNEL)
3837

3938
.PHONY: catalog
4039
catalog: $(OPM) ## Generate catalog content and validate.

utils/generate-catalog.sh

+2-5
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,13 @@ set -euo pipefail
77
### CONSTANTS
88
# Used as well in the subscription object
99
DEFAULT_CHANNEL=preview
10-
DEFAULT_REPLACES_VERSION=0.0.0-alpha
1110
###
1211

1312
OPM="${1?:Error \$OPM not set. Bye}"
1413
YQ="${2?:Error \$YQ not set. Bye}"
1514
BUNDLE_IMG="${3?:Error \$BUNDLE_IMG not set. Bye}"
1615
CATALOG_FILE="${4?:Error \$CATALOG_FILE not set. Bye}"
17-
REPLACES_VERSION="${5:-$DEFAULT_REPLACES_VERSION}"
18-
CHANNEL="${6:-$DEFAULT_CHANNEL}"
16+
CHANNEL="${5:-$DEFAULT_CHANNEL}"
1917

2018
CATALOG_FILE_BASEDIR="$( cd "$( dirname "$(realpath ${CATALOG_FILE})" )" && pwd )"
2119
CATALOG_BASEDIR="$( cd "$( dirname "$(realpath ${CATALOG_FILE_BASEDIR})" )" && pwd )"
@@ -36,8 +34,7 @@ ${OPM} init limitador-operator --default-channel=${CHANNEL} --output yaml >> ${C
3634
cat ${TMP_DIR}/limitador-operator-bundle.yaml >> ${CATALOG_FILE}
3735
# Add a channel entry for the bundle
3836
V=`${YQ} eval '.name' ${TMP_DIR}/limitador-operator-bundle.yaml` \
39-
REPLACES=limitador-operator.v${REPLACES_VERSION} \
4037
CHANNEL=${CHANNEL} \
41-
${YQ} eval '(.entries[0].name = strenv(V)) | (.entries[0].replaces = strenv(REPLACES)) | (.name = strenv(CHANNEL))' ${CATALOG_BASEDIR}/limitador-operator-channel-entry.yaml >> ${CATALOG_FILE}
38+
${YQ} eval '(.entries[0].name = strenv(V)) | (.name = strenv(CHANNEL))' ${CATALOG_BASEDIR}/limitador-operator-channel-entry.yaml >> ${CATALOG_FILE}
4239

4340
rm -rf $TMP_DIR

0 commit comments

Comments
 (0)