1
1
# VERSION defines the project version for the bundle.
2
2
# Update this value when you upgrade the version of your project.
3
3
# To re-generate a bundle for another specific version without changing the standard setup, you can:
4
- # - use the VERSION as arg of the bundle target (e.g make bundle VERSION=0 .0.2)
5
- # - use environment variables to overwrite this value (e.g export VERSION=0 .0.2)
4
+ # - use the VERSION as arg of the bundle target (e.g make bundle VERSION=v0 .0.2)
5
+ # - use environment variables to overwrite this value (e.g export VERSION=v0 .0.2)
6
6
# best if we could detect this. If we cannot, we need to document it somewhere.
7
7
# then we can add a patch in the `PHONY: bundle`
8
+ # BUNDLE_VERSION is declared as bundle versioning doesn't use semver
8
9
9
- PREVIOUS_VERSION ?= 0.0.0-dev
10
- VERSION ?= 0.0.0-dev
10
+ PREVIOUS_VERSION ?= v0.0.0-dev
11
+ VERSION ?= v0.0.0-dev
12
+ BUNDLE_VERSION ?= $(VERSION:v%=% )
11
13
12
14
# INSTASCALE_VERSION defines the default version of the InstaScale controller
13
15
INSTASCALE_VERSION ?= v0.0.4
@@ -19,6 +21,11 @@ MCAD_REF ?= release-${MCAD_VERSION}
19
21
MCAD_REPO ?= github.com/project-codeflare/multi-cluster-app-dispatcher
20
22
MCAD_CRD ?= ${MCAD_REPO}/config/crd?ref=${MCAD_REF}
21
23
24
+ # OPERATORS_REPO_ORG points to GitHub repository organization where bundle PR is opened against
25
+ # OPERATORS_REPO_FORK_ORG points to GitHub repository fork organization where bundle build is pushed to
26
+ OPERATORS_REPO_ORG ?= redhat-openshift-ecosystem
27
+ OPERATORS_REPO_FORK_ORG ?= project-codeflare
28
+
22
29
# CHANNELS define the bundle channels used in the bundle.
23
30
# Add a new line here if you would like to change its default config. (E.g CHANNELS = "candidate,fast,stable")
24
31
# To re-generate a bundle for other specific channels without changing the standard setup, you can:
@@ -48,15 +55,18 @@ IMAGE_ORG_BASE ?= quay.io/project-codeflare
48
55
# codeflare.dev/codeflare-operator-bundle:$VERSION and codeflare.dev/codeflare-operator-catalog:$VERSION.
49
56
IMAGE_TAG_BASE ?= $(IMAGE_ORG_BASE ) /codeflare-operator
50
57
58
+ # MCAD_IMAGE defines the default container image for the MCAD controller
59
+ MCAD_IMAGE ?= $(IMAGE_ORG_BASE ) /mcad-controller:$(MCAD_REF )
60
+
51
61
# INSTASCALE_IMAGE defines the default container image for the InstaScale controller
52
62
INSTASCALE_IMAGE ?= $(IMAGE_ORG_BASE ) /instascale-controller:$(INSTASCALE_VERSION )
53
63
54
64
# BUNDLE_IMG defines the image:tag used for the bundle.
55
65
# You can use it as an arg. (E.g make bundle-build BUNDLE_IMG=<some-registry>/<project-name-bundle>:<tag>)
56
- BUNDLE_IMG ?= $(IMAGE_TAG_BASE ) -bundle:v $(VERSION )
66
+ BUNDLE_IMG ?= $(IMAGE_TAG_BASE ) -bundle:$(VERSION )
57
67
58
68
# BUNDLE_GEN_FLAGS are the flags passed to the operator-sdk generate bundle command
59
- BUNDLE_GEN_FLAGS ?= -q --overwrite --version $(VERSION ) $(BUNDLE_METADATA_OPTS )
69
+ BUNDLE_GEN_FLAGS ?= -q --overwrite --version $(BUNDLE_VERSION ) $(BUNDLE_METADATA_OPTS )
60
70
61
71
# USE_IMAGE_DIGESTS defines if images are resolved via tags or digests
62
72
# You can enable this value if you would like to use SHA Based Digests
@@ -67,7 +77,7 @@ ifeq ($(USE_IMAGE_DIGESTS), true)
67
77
endif
68
78
69
79
# Image URL to use all building/pushing image targets
70
- IMG ?= ${IMAGE_TAG_BASE}:v ${VERSION}
80
+ IMG ?= ${IMAGE_TAG_BASE}:${VERSION}
71
81
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
72
82
ENVTEST_K8S_VERSION = 1.24.2
73
83
@@ -117,6 +127,7 @@ defaults:
117
127
@echo " // ***********************" >> $(DEFAULTS_FILE )
118
128
@echo " " >> $(DEFAULTS_FILE )
119
129
@echo " const (" >> $(DEFAULTS_FILE )
130
+ @echo " MCADImage = \" $( MCAD_IMAGE) \" " >> $(DEFAULTS_FILE )
120
131
@echo " InstaScaleImage = \" $( INSTASCALE_IMAGE) \" " >> $(DEFAULTS_FILE )
121
132
@echo " " >> $(DEFAULTS_FILE )
122
133
@echo " )" >> $(DEFAULTS_FILE )
@@ -308,7 +319,7 @@ bundle: defaults manifests kustomize install-operator-sdk ## Generate bundle man
308
319
$(KUSTOMIZE ) fn run config/crd/mcad --image gcr.io/kpt-fn/apply-setters:v0.2.0 -- MCAD_CRD=$(MCAD_CRD )
309
320
cd config/manager && $(KUSTOMIZE ) edit set image controller=$(IMG )
310
321
cd config/manifests && $(KUSTOMIZE ) edit add patch --patch ' [{"op":"add", "path":"/metadata/annotations/containerImage", "value": "$(IMG)" }]' --kind ClusterServiceVersion
311
- cd config/manifests && $(KUSTOMIZE ) edit add patch --patch ' [{"op":"add", "path":"/spec/replaces", "value": "codeflare-operator.v $(PREVIOUS_VERSION)" }]' --kind ClusterServiceVersion
322
+ cd config/manifests && $(KUSTOMIZE ) edit add patch --patch ' [{"op":"add", "path":"/spec/replaces", "value": "codeflare-operator.$(PREVIOUS_VERSION)" }]' --kind ClusterServiceVersion
312
323
$(KUSTOMIZE ) build config/manifests | $(OPERATOR_SDK ) generate bundle $(BUNDLE_GEN_FLAGS )
313
324
$(MAKE ) validate-bundle
314
325
git restore config/*
@@ -321,13 +332,13 @@ bundle-build: bundle ## Build the bundle image.
321
332
bundle-push : # # Push the bundle image.
322
333
$(MAKE ) image-push IMG=$(BUNDLE_IMG )
323
334
324
- .PHONY : openshift-community-operator-releases
335
+ .PHONY : openshift-community-operator-release
325
336
openshift-community-operator-release : install-gh-cli bundle # # build bundle and create PR in OpenShift community operators repository
326
- gh repo clone git @github.com:project-codeflare /community-operators-prod.git
327
- cd community-operators-prod && git pull upstream main && git push origin main
328
- cp -r bundle community-operators-prod/operators/codeflare-operator/$(VERSION )
329
- cd community-operators-prod && git checkout -b codeflare-release-$(VERSION ) && git add operators/codeflare-operator/$(VERSION ) /* && git commit -s - m " add bundle manifests codeflare version $( VERSION ) " && git push origin codeflare-release-$(VERSION )
330
- gh pr create --repo redhat-openshift-ecosystem /community-operators-prod --title " CodeFlare $( VERSION ) " --body " New release of codeflare operator" --head project-codeflare :codeflare-release-$(VERSION ) --base main
337
+ git clone https:// $( GH_TOKEN ) @github.com/ $( OPERATORS_REPO_FORK_ORG ) /community-operators-prod.git
338
+ cd community-operators-prod && git remote add upstream https://github.com/ $( OPERATORS_REPO_ORG ) /community-operators-prod.git && git pull upstream main && git push origin main
339
+ cp -r bundle community-operators-prod/operators/codeflare-operator/$(BUNDLE_VERSION )
340
+ cd community-operators-prod && git checkout -b codeflare-release-$(BUNDLE_VERSION ) && git add operators/codeflare-operator/$(BUNDLE_VERSION ) /* && git commit -m " add bundle manifests codeflare version $( BUNDLE_VERSION ) " && git push origin codeflare-release-$(BUNDLE_VERSION )
341
+ gh pr create --repo $( OPERATORS_REPO_FORK_ORG ) /community-operators-prod --title " CodeFlare $( BUNDLE_VERSION ) " --body " New release of codeflare operator" --head $( OPERATORS_REPO_ORG ) :codeflare-release-$(BUNDLE_VERSION ) --base main
331
342
rm -rf community-operators-prod
332
343
333
344
.PHONY : opm
@@ -352,7 +363,7 @@ endif
352
363
BUNDLE_IMGS ?= $(BUNDLE_IMG )
353
364
354
365
# The image tag given to the resulting catalog image (e.g. make catalog-build CATALOG_IMG=example.com/operator-catalog:v0.2.0).
355
- CATALOG_IMG ?= $(IMAGE_TAG_BASE ) -catalog:v $(VERSION )
366
+ CATALOG_IMG ?= $(IMAGE_TAG_BASE ) -catalog:$(VERSION )
356
367
357
368
# Set CATALOG_BASE_IMG to an existing catalog image tag to add $BUNDLE_IMGS to that image.
358
369
ifneq ($(origin CATALOG_BASE_IMG ) , undefined)
0 commit comments