3
3
# To re-generate a bundle for another specific version without changing the standard setup, you can:
4
4
# - use the VERSION as arg of the bundle target (e.g make bundle VERSION=0.0.2)
5
5
# - use environment variables to overwrite this value (e.g export VERSION=0.0.2)
6
- VERSION ?= 0.0.1
6
+ VERSION ?= 0.0.0
7
7
8
8
# CHANNELS define the bundle channels used in the bundle.
9
9
# Add a new line here if you would like to change its default config. (E.g CHANNELS = "candidate,fast,stable")
@@ -24,19 +24,31 @@ BUNDLE_DEFAULT_CHANNEL := --default-channel=$(DEFAULT_CHANNEL)
24
24
endif
25
25
BUNDLE_METADATA_OPTS ?= $(BUNDLE_CHANNELS ) $(BUNDLE_DEFAULT_CHANNEL )
26
26
27
+ # Address of the container registry
28
+ REGISTRY = quay.io
29
+
30
+ # Organization in container registry
31
+ ORG ?= kuadrant
32
+
27
33
# IMAGE_TAG_BASE defines the docker.io namespace and part of the image name for remote images.
28
34
# This variable is used to construct full image tags for bundle and catalog images.
29
35
#
30
36
# For example, running 'make bundle-build bundle-push catalog-build catalog-push' will build and push both
31
37
# quay.io/kuadrant/kuadrant-operator-bundle:$VERSION and quay.io/kuadrant/kuadrant-operator-catalog:$VERSION.
32
- IMAGE_TAG_BASE ?= quay.io/kuadrant/kuadrant-operator
38
+ IMAGE_TAG_BASE ?= $(REGISTRY ) /$(ORG ) /kuadrant-operator
39
+
40
+ ifeq (0.0.0,$(VERSION ) )
41
+ IMAGE_TAG = latest
42
+ else
43
+ IMAGE_TAG = v$(VERSION )
44
+ endif
33
45
34
46
# BUNDLE_IMG defines the image:tag used for the bundle.
35
47
# You can use it as an arg. (E.g make bundle-build BUNDLE_IMG=<some-registry>/<project-name-bundle>:<tag>)
36
- BUNDLE_IMG ?= $(IMAGE_TAG_BASE ) -bundle:v $( VERSION )
48
+ BUNDLE_IMG ?= $(IMAGE_TAG_BASE ) -bundle:$( IMAGE_TAG )
37
49
38
50
# Image URL to use all building/pushing image targets
39
- IMG ?= quay.io/kuadrant/kuadrant-operator:latest
51
+ IMG ?= $( IMAGE_TAG_BASE ) : $( IMAGE_TAG )
40
52
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
41
53
ENVTEST_K8S_VERSION = 1.22
42
54
53
65
SHELL = /usr/bin/env bash -o pipefail
54
66
.SHELLFLAGS = -ec
55
67
68
+ # Kuadrant component versions
69
+ # # kuadrant controller
70
+ # ToDo Pin this version once we have an initial release of the controller
71
+ KUADRANT_CONTROLLER_VERSION ?= latest
72
+ ifeq (latest,$(KUADRANT_CONTROLLER_VERSION ) )
73
+ KUADRANT_CONTROLLER_GITREF = main
74
+ else
75
+ KUADRANT_CONTROLLER_GITREF = $(KUADRANT_CONTROLLER_VERSION )
76
+ endif
77
+ # # authorino
78
+ # ToDo Pin this version once we have an initial release of authorino
79
+ AUTHORINO_OPERATOR_VERSION ?= latest
80
+ ifeq (latest,$(AUTHORINO_OPERATOR_VERSION ) )
81
+ AUTHORINO_OPERATOR_BUNDLE_VERSION = 0.0.0
82
+ AUTHORINO_OPERATOR_BUNDLE_IMG_TAG = latest
83
+ AUTHORINO_OPERATOR_GITREF = main
84
+ else
85
+ AUTHORINO_OPERATOR_BUNDLE_VERSION = ${AUTHORINO_OPERATOR_VERSION}
86
+ AUTHORINO_OPERATOR_BUNDLE_IMG_TAG = v$(AUTHORINO_OPERATOR_BUNDLE_VERSION )
87
+ AUTHORINO_OPERATOR_GITREF = v$(AUTHORINO_OPERATOR_BUNDLE_VERSION )
88
+ endif
89
+ AUTHORINO_OPERATOR_BUNDLE_IMG ?= quay.io/kuadrant/authorino-operator-bundle:$(AUTHORINO_OPERATOR_BUNDLE_IMG_TAG )
90
+ # # limitador
91
+ # ToDo Pin this version once we have an initial release of limitador
92
+ LIMITADOR_OPERATOR_VERSION ?= latest
93
+ ifeq (latest,$(LIMITADOR_OPERATOR_VERSION ) )
94
+ LIMITADOR_OPERATOR_BUNDLE_VERSION = 0.0.0
95
+ LIMITADOR_OPERATOR_BUNDLE_IMG_TAG = latest
96
+ LIMITADOR_OPERATOR_GITREF = main
97
+ else
98
+ LIMITADOR_OPERATOR_BUNDLE_VERSION = $(LIMITADOR_OPERATOR_VERSION )
99
+ LIMITADOR_OPERATOR_BUNDLE_IMG_TAG = v$(LIMITADOR_OPERATOR_BUNDLE_VERSION )
100
+ LIMITADOR_OPERATOR_GITREF = v$(LIMITADOR_OPERATOR_BUNDLE_VERSION )
101
+ endif
102
+ LIMITADOR_OPERATOR_BUNDLE_IMG ?= quay.io/kuadrant/limitador-operator-bundle:$(LIMITADOR_OPERATOR_BUNDLE_IMG_TAG )
103
+
56
104
all : build
57
105
58
106
# #@ General
@@ -73,9 +121,24 @@ help: ## Display this help.
73
121
74
122
# #@ Development
75
123
76
- manifests : controller-gen # # Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
124
+ manifests : controller-gen dependencies-manifests # # Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
77
125
$(CONTROLLER_GEN ) rbac:roleName=manager-role crd webhook paths=" ./..." output:crd:artifacts:config=config/crd/bases
78
126
127
+ .PHONY : dependencies-manifests
128
+ dependencies-manifests : export KUADRANT_CONTROLLER_GITREF := $(KUADRANT_CONTROLLER_GITREF )
129
+ dependencies-manifests : export AUTHORINO_OPERATOR_GITREF := $(AUTHORINO_OPERATOR_GITREF )
130
+ dependencies-manifests : export LIMITADOR_OPERATOR_GITREF := $(LIMITADOR_OPERATOR_GITREF )
131
+ dependencies-manifests : # # Update kuadrant dependencies manifests.
132
+ envsubst \
133
+ < config/dependencies/controller/kustomization.template.yaml \
134
+ > config/dependencies/controller/kustomization.yaml
135
+ envsubst \
136
+ < config/dependencies/authorino/kustomization.template.yaml \
137
+ > config/dependencies/authorino/kustomization.yaml
138
+ envsubst \
139
+ < config/dependencies/limitador/kustomization.template.yaml \
140
+ > config/dependencies/limitador/kustomization.yaml
141
+
79
142
generate : controller-gen # # Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
80
143
$(CONTROLLER_GEN ) object:headerFile=" hack/boilerplate.go.txt" paths=" ./..."
81
144
@@ -96,7 +159,7 @@ build: generate fmt vet ## Build manager binary.
96
159
run : manifests generate fmt vet # # Run a controller from your host.
97
160
go run ./main.go
98
161
99
- docker-build : test # # Build docker image with the manager.
162
+ docker-build : # # Build docker image with the manager.
100
163
docker build -t ${IMG} .
101
164
102
165
docker-push : # # Push docker image with the manager.
@@ -112,11 +175,24 @@ uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified
112
175
113
176
deploy : manifests kustomize # # Deploy controller to the K8s cluster specified in ~/.kube/config.
114
177
cd config/manager && $(KUSTOMIZE ) edit set image controller=${IMG}
115
- $(KUSTOMIZE ) build config/default | kubectl apply -f -
178
+ $(KUSTOMIZE ) build config/deploy | kubectl apply -f -
116
179
117
180
undeploy : # # Undeploy controller from the K8s cluster specified in ~/.kube/config.
118
- $(KUSTOMIZE ) build config/default | kubectl delete -f -
181
+ $(KUSTOMIZE ) build config/deploy | kubectl delete -f -
119
182
183
+ .PHONY : install-olm
184
+ install-olm :
185
+ $(OPERATOR_SDK ) olm install
186
+
187
+ .PHONY : uninstall-olm
188
+ uninstall-olm :
189
+ $(OPERATOR_SDK ) olm uninstall
190
+
191
+ deploy-olm : # # Deploy controller to the K8s cluster specified in ~/.kube/config using OLM catalog image.
192
+ ./bin/kustomize build config/deploy/olm | kubectl apply -f -
193
+
194
+ undeploy-olm : # # Undeploy controller from the K8s cluster specified in ~/.kube/config using OLM catalog image.
195
+ ./bin/kustomize build config/deploy/olm | kubectl delete -f -
120
196
121
197
CONTROLLER_GEN = $(shell pwd) /bin/controller-gen
122
198
controller-gen : # # Download controller-gen locally if necessary.
@@ -149,8 +225,14 @@ OPERATOR_SDK_VERSION = v1.15.0
149
225
operator-sdk : # # Download operator-sdk locally if necessary.
150
226
./utils/install-operator-sdk.sh $(OPERATOR_SDK ) $(OPERATOR_SDK_VERSION )
151
227
228
+ .PHONY : bundle-dependencies
229
+ bundle-dependencies : export AUTHORINO_OPERATOR_BUNDLE_VERSION := $(AUTHORINO_OPERATOR_BUNDLE_VERSION )
230
+ bundle-dependencies : export LIMITADOR_OPERATOR_BUNDLE_VERSION := $(LIMITADOR_OPERATOR_BUNDLE_VERSION )
231
+ bundle-dependencies : # # Generate bundle dependencies file.
232
+ ./utils/generate-dependencies-yaml.sh > bundle/metadata/dependencies.yaml
233
+
152
234
.PHONY : bundle
153
- bundle : manifests kustomize operator-sdk # # Generate bundle manifests and metadata, then validate generated files.
235
+ bundle : manifests kustomize operator-sdk bundle-dependencies # # Generate bundle manifests and metadata, then validate generated files.
154
236
$(OPERATOR_SDK ) generate kustomize manifests -q
155
237
cd config/manager && $(KUSTOMIZE ) edit set image controller=$(IMG )
156
238
$(KUSTOMIZE ) build config/manifests | $(OPERATOR_SDK ) generate bundle -q --overwrite --version $(VERSION ) $(BUNDLE_METADATA_OPTS )
@@ -183,10 +265,10 @@ endif
183
265
184
266
# A comma-separated list of bundle images (e.g. make catalog-build BUNDLE_IMGS=example.com/operator-bundle:v0.1.0,example.com/operator-bundle:v0.2.0).
185
267
# These images MUST exist in a registry and be pull-able.
186
- BUNDLE_IMGS ?= $(BUNDLE_IMG )
268
+ BUNDLE_IMGS ?= $(BUNDLE_IMG ) , $( LIMITADOR_OPERATOR_BUNDLE_IMG ) , $( AUTHORINO_OPERATOR_BUNDLE_IMG )
187
269
188
270
# The image tag given to the resulting catalog image (e.g. make catalog-build CATALOG_IMG=example.com/operator-catalog:v0.2.0).
189
- CATALOG_IMG ?= $(IMAGE_TAG_BASE ) -catalog:v $( VERSION )
271
+ CATALOG_IMG ?= $(IMAGE_TAG_BASE ) -catalog:$( IMAGE_TAG )
190
272
191
273
# Set CATALOG_BASE_IMG to an existing catalog image tag to add $BUNDLE_IMGS to that image.
192
274
ifneq ($(origin CATALOG_BASE_IMG ) , undefined)
0 commit comments