@@ -52,6 +52,13 @@ KIND_NODE_VERSION ?= $(KUBE_MINOR).0
52
52
KIND_CLUSTER_NAME ?= kind-olmv0
53
53
KIND_CLUSTER_IMAGE := kindest/node:v$(KIND_NODE_VERSION )
54
54
55
+ # Take operator registry tag from operator registry version in go.mod
56
+ export OPERATOR_REGISTRY_TAG ?= $(shell go list -m github.com/operator-framework/operator-registry | cut -d" " -f2)
57
+
58
+ # Pin operator registry images to the OPERATOR_REGISTRY_TAG
59
+ export OPERATOR_REGISTRY_IMAGE ?= quay.io/operator-framework/opm :$(OPERATOR_REGISTRY_TAG )
60
+ export CONFIGMAP_SERVER_IMAGE ?= quay.io/operator-framework/configmap-operator-registry :$(OPERATOR_REGISTRY_TAG )
61
+
55
62
# Phony prerequisite for targets that rely on the go build cache to determine staleness.
56
63
.PHONY : build test clean vendor \
57
64
coverage coverage-html e2e \
@@ -126,10 +133,16 @@ e2e.namespace:
126
133
@printf " e2e-tests-$( shell date +%s) -$$ RANDOM" > e2e.namespace
127
134
128
135
.PHONY : e2e
129
- GINKGO_E2E_OPTS += -timeout 90m -v -randomize-suites -race -trace --show-node-events
130
- E2E_OPTS += -namespace=operators -olmNamespace=operator-lifecycle-manager -catalogNamespace=operator-lifecycle-manager -dummyImage=bitnami/nginx:latest
136
+ E2E_TIMEOUT ?= 90m
137
+ E2E_TEST_NS ?= operators
138
+ E2E_INSTALL_NS ?= operator-lifecycle-manager
139
+ E2E_CATALOG_NS ?= $(E2E_INSTALL_NS )
140
+ GINKGO_OPTS += -v -randomize-suites -race -trace --show-node-events
131
141
e2e :
132
- $(GINKGO ) $(GINKGO_E2E_OPTS ) ./test/e2e -- $(E2E_OPTS )
142
+ $(GINKGO ) -timeout $(E2E_TIMEOUT ) $(GINKGO_OPTS ) ./test/e2e -- -namespace=$(E2E_TEST_NS ) -olmNamespace=$(E2E_INSTALL_NS ) -catalogNamespace=$(E2E_CATALOG_NS ) $(E2E_OPTS )
143
+
144
+ .PHONY : e2e-local
145
+ e2e-local : e2e-build kind-create deploy e2e
133
146
134
147
.PHONY : kind-clean
135
148
kind-clean :
@@ -144,12 +157,14 @@ kind-create: kind-clean
144
157
OLM_IMAGE := quay.io/operator-framework/olm:local
145
158
deploy :
146
159
$(KIND ) load docker-image $(OLM_IMAGE ) --name $(KIND_CLUSTER_NAME ) ; \
147
- $(HELM ) install olm deploy/chart \
160
+ $(HELM ) upgrade -- install olm deploy/chart \
148
161
--set debug=true \
149
162
--set olm.image.ref=$(OLM_IMAGE ) \
150
163
--set olm.image.pullPolicy=IfNotPresent \
151
164
--set catalog.image.ref=$(OLM_IMAGE ) \
152
165
--set catalog.image.pullPolicy=IfNotPresent \
166
+ --set catalog.commandArgs=--configmapServerImage=$(CONFIGMAP_SERVER_IMAGE ) \
167
+ --set catalog.opmImageArgs=--opmImage=$(OPERATOR_REGISTRY_IMAGE ) \
153
168
--set package.image.ref=$(OLM_IMAGE ) \
154
169
--set package.image.pullPolicy=IfNotPresent \
155
170
$(HELM_INSTALL_OPTS ) \
@@ -158,7 +173,6 @@ deploy:
158
173
.PHONY : e2e-build
159
174
e2e-build : BUILD_TAGS="json1 e2e experimental_metrics"
160
175
e2e-build : export GOOS=linux
161
- e2e-build : export GOARCH=amd64
162
176
e2e-build : build_cmd=build
163
177
e2e-build : e2e.Dockerfile bin/wait bin/cpb $(CMDS )
164
178
docker build -t quay.io/operator-framework/olm:local -f $< bin
@@ -213,25 +227,34 @@ verify-manifests: manifests
213
227
214
228
verify : vendor verify-codegen verify-mockgen verify-manifests
215
229
230
+ .PHONY : pull-opm
231
+ pull-opm :
232
+ docker pull $(OPERATOR_REGISTRY_IMAGE )
233
+
216
234
# before running release, bump the version in OLM_VERSION and push to master,
217
235
# then tag those builds in quay with the version in OLM_VERSION
218
236
release : ver=v$(shell cat OLM_VERSION)
219
- release : manifests
237
+ # pull the opm image to get the digest
238
+ release : pull-opm manifests
220
239
@echo " Generating the $( ver) release"
221
240
docker pull $(IMAGE_REPO ) :$(ver )
222
241
$(MAKE ) target=upstream ver=$(ver ) quickstart=true package
223
242
224
243
package : olmref=$(shell docker inspect --format='{{index .RepoDigests 0}}' $(IMAGE_REPO ) :$(ver ) )
244
+ package : opmref=$(shell docker inspect --format='{{index .RepoDigests 0}}' $(OPERATOR_REGISTRY_IMAGE ) )
225
245
package :
226
246
ifndef target
227
247
$(error target is undefined)
228
248
endif
229
249
ifndef ver
230
250
$(error ver is undefined)
231
251
endif
252
+ @echo "Getting operator registry image"
253
+ docker pull $(OPERATOR_REGISTRY_IMAGE)
232
254
$(YQ_INTERNAL) w -i deploy/$(target)/values.yaml olm.image.ref $(olmref)
233
255
$(YQ_INTERNAL) w -i deploy/$(target)/values.yaml catalog.image.ref $(olmref)
234
256
$(YQ_INTERNAL) w -i deploy/$(target)/values.yaml package.image.ref $(olmref)
257
+ $(YQ_INTERNAL) w -i deploy/$(target)/values.yaml -- catalog.opmImageArgs "--opmImage=$(opmref)"
235
258
./scripts/package_release.sh $(ver) deploy/$(target)/manifests/$(ver) deploy/$(target)/values.yaml
236
259
ln -sfFn ./$(ver) deploy/$(target)/manifests/latest
237
260
ifeq ($(quickstart ) , true)
0 commit comments