Skip to content

Commit 8bb48c9

Browse files
nixpanicopenshift-cherrypick-robot
authored andcommitted
build: version the bundle/CSV the same as the tag of the container-images
When a release is made, the git-tag is used for the version of the container-images. It seems that ODF-Operator assumes the tag of the container-image matches what is used as a version of the bundle/CSV. There is no hard requirement that these versions are the same, it is just an assumption of ODF-Operator. However, it is the first operator that deploys CSI-Addons, and changing the operator seems more complex than versioning csi-addons differently. The default version in csi-addons.clusterserviceversion.yaml has now been set to 0.1.1, the latest git-tag that was published. Fixes: csi-addons#82 Signed-off-by: Niels de Vos <ndevos@redhat.com>
1 parent 17373d8 commit 8bb48c9

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

Makefile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,12 @@ BUNDLE_IMG ?= quay.io/csiaddons/k8s-bundle
77
# set TAG to a release for consumption in the bundle
88
TAG ?= latest
99

10-
# version of the package inside the bundle, can be different from the TAG
11-
BUNDLE_VERSION ?= 0.0.1
10+
# The default version of the bundle (CSV) can be found in
11+
# config/manifests/bases/csi-addons.clusterserviceversion.yaml . When tagging a
12+
# release, the bundle will be versioned with the same value as well.
13+
ifneq ($(TAG),latest)
14+
BUNDLE_VERSION ?= --version=$(shell sed s/^v// <<< $(TAG))
15+
endif
1216

1317
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
1418
ENVTEST_K8S_VERSION = 1.23
@@ -55,7 +59,7 @@ manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and Cust
5559
.PHONY: bundle
5660
bundle: kustomize operator-sdk
5761
cd config/manager && $(KUSTOMIZE) edit set image controller=$(CONTROLLER_IMG):$(TAG)
58-
$(KUSTOMIZE) build config/default | $(OPERATOR_SDK) generate bundle --manifests --metadata --package=csi-addons --version=$(BUNDLE_VERSION)
62+
$(KUSTOMIZE) build config/default | $(OPERATOR_SDK) generate bundle --manifests --metadata --package=csi-addons $(BUNDLE_VERSION)
5963
mkdir -p ./bundle/tests/scorecard && $(KUSTOMIZE) build config/scorecard --output=./bundle/tests/scorecard/config.yaml
6064

6165
.PHONY: generate

config/manifests/bases/csi-addons.clusterserviceversion.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ metadata:
44
annotations:
55
alm-examples: '[]'
66
capabilities: Basic Install
7-
name: csi-addons.v0.0.0
7+
name: csi-addons.v0.1.1
88
namespace: placeholder
99
spec:
1010
apiservicedefinitions: {}
@@ -61,4 +61,4 @@ spec:
6161
maturity: alpha
6262
provider:
6363
name: CSI Addons Community
64-
version: 0.0.0
64+
version: 0.1.1

0 commit comments

Comments
 (0)