Skip to content

Commit c233ef0

Browse files
author
Per Goncalves da Silva
committed
pin opm image
Signed-off-by: Per Goncalves da Silva <[email protected]>
1 parent db6656c commit c233ef0

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

Diff for: Makefile

+13-5
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,13 @@ KIND_NODE_VERSION ?= $(KUBE_MINOR).0
5252
KIND_CLUSTER_NAME ?= kind-olmv0
5353
KIND_CLUSTER_IMAGE := kindest/node:v$(KIND_NODE_VERSION)
5454

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 deployment to those images export
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+
5562
# Phony prerequisite for targets that rely on the go build cache to determine staleness.
5663
.PHONY: build test clean vendor \
5764
coverage coverage-html e2e \
@@ -130,9 +137,9 @@ E2E_TIMEOUT ?= 90m
130137
E2E_TEST_NS ?= operators
131138
E2E_INSTALL_NS ?= operator-lifecycle-manager
132139
E2E_CATALOG_NS ?= $(E2E_INSTALL_NS)
133-
GINKGO_OPTS =? -v -randomize-suites -race -trace --show-node-events
140+
GINKGO_OPTS ?= -v -randomize-suites -race -trace --show-node-events
134141
e2e:
135-
$(GINKGO) -timeout $(E2E_TIMEOUT) $(GINKGO_OPTS) ./test/e2e -- -namespace=E2E_TEST_NS -olmNamespace=$(E2E_INSTALL_NS) -catalogNamespace=$(E2E_CATALOG_NS) $(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)
136143

137144
.PHONY: e2e-local
138145
e2e-local: e2e-build kind-create deploy e2e
@@ -150,21 +157,22 @@ kind-create: kind-clean
150157
OLM_IMAGE := quay.io/operator-framework/olm:local
151158
deploy:
152159
$(KIND) load docker-image $(OLM_IMAGE) --name $(KIND_CLUSTER_NAME); \
153-
$(HELM) install olm deploy/chart \
160+
$(HELM) upgrade --install olm deploy/chart \
154161
--set debug=true \
155162
--set olm.image.ref=$(OLM_IMAGE) \
156163
--set olm.image.pullPolicy=IfNotPresent \
157164
--set catalog.image.ref=$(OLM_IMAGE) \
158165
--set catalog.image.pullPolicy=IfNotPresent \
166+
--set catalog.commandArgs=--configmapServerImage=$(CONFIGMAP_SERVER_IMAGE)\
167+
--set catalog.opmImageArgs=--opmImage=$(OPERATOR_REGISTRY_IMAGE) \
159168
--set package.image.ref=$(OLM_IMAGE) \
160169
--set package.image.pullPolicy=IfNotPresent \
161170
$(HELM_INSTALL_OPTS) \
162171
--wait;
163172

164173
.PHONY: e2e-build
165174
e2e-build: BUILD_TAGS="json1 e2e experimental_metrics"
166-
e2e-build: export GOOS=linux
167-
e2e-build: export GOARCH=amd64
175+
e2e-build: GOOS=linux
168176
e2e-build: build_cmd=build
169177
e2e-build: e2e.Dockerfile bin/wait bin/cpb $(CMDS)
170178
docker build -t quay.io/operator-framework/olm:local -f $< bin

Diff for: test/e2e/magic_catalog.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package e2e
33
import (
44
"context"
55
"fmt"
6+
"os"
67

78
operatorsv1alpha1 "github.com/operator-framework/api/pkg/operators/v1alpha1"
89
corev1 "k8s.io/api/core/v1"
@@ -257,12 +258,16 @@ func (c *MagicCatalog) makeCatalogSource() *operatorsv1alpha1.CatalogSource {
257258
func (c *MagicCatalog) makeCatalogSourcePod() *corev1.Pod {
258259

259260
const (
260-
image = "quay.io/operator-framework/opm"
261261
readinessDelay int32 = 5
262262
livenessDelay int32 = 10
263263
volumeMountName string = "fbc-catalog"
264264
)
265265

266+
var image = "quay.io/operator-framework/opm"
267+
if os.Getenv("OPERATOR_REGISTRY_TAG") != "" {
268+
image = fmt.Sprintf("quay.io/operator-framework/opm:%s", os.Getenv("OPERATOR_REGISTRY_TAG"))
269+
}
270+
266271
return &corev1.Pod{
267272
ObjectMeta: metav1.ObjectMeta{
268273
Name: c.podName,

0 commit comments

Comments
 (0)