Skip to content

Commit 6b7e5b9

Browse files
committed
Added operator-sdk support to the e2e workflow
Signed-off-by: jubittajohn <[email protected]> Refractored the plain bundle and registry bundle interactions; Updated the comments and README Signed-off-by: jubittajohn <[email protected]> Added make target to install operator-sdk; Added make target to deploy a local registry server; Changed test to use the local registry server Signed-off-by: jubittajohn <[email protected]>
1 parent 737c0de commit 6b7e5b9

15 files changed

+1525
-851
lines changed

.github/workflows/operator-developer-e2e.yaml

Whitespace-only changes.

.github/workflows/operator-framework-e2e.yaml

Lines changed: 0 additions & 23 deletions
This file was deleted.

Makefile

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ E2E_FLAGS ?= ""
9999
test-e2e: $(GINKGO) ## Run the e2e tests
100100
$(GINKGO) --tags $(GO_BUILD_TAGS) $(E2E_FLAGS) -trace -progress $(FOCUS) test/e2e
101101

102+
.PHONY: test-operator-developer-e2e
103+
test-operator-developer-e2e: $(GINKGO) ## Run operator create, upgrade and delete tests
104+
$(GINKGO) --tags $(GO_BUILD_TAGS) $(E2E_FLAGS) -trace -progress test/operator-framework-e2e
105+
102106
.PHONY: test-unit
103107
ENVTEST_VERSION = $(shell go list -m k8s.io/client-go | cut -d" " -f2 | sed 's/^v0\.\([[:digit:]]\{1,\}\)\.[[:digit:]]\{1,\}$$/1.\1.x/')
104108
UNIT_TEST_DIRS=$(shell go list ./... | grep -v /test/)
@@ -115,9 +119,8 @@ e2e: KUSTOMIZE_BUILD_DIR=config/e2e
115119
e2e: GO_BUILD_FLAGS=-cover
116120
e2e: run kind-load-test-artifacts test-e2e e2e-coverage kind-cluster-cleanup ## Run e2e test suite on local kind cluster
117121

118-
.PHONY: operator-framework-e2e
119-
operator-framework-e2e: KIND_CLUSTER_NAME=operator-controller-e2e ## Run operator-framework e2e on local kind cluster
120-
operator-framework-e2e: run opm test-operator-framework-e2e kind-cluster-cleanup
122+
operator-developer-e2e: KIND_CLUSTER_NAME=operator-controller-e2e ## Run operator-developer e2e on local kind cluster
123+
operator-developer-e2e: run opm install-operator-sdk deploy-local-registry test-operator-developer-e2e stop-local-registry kind-cluster-cleanup
121124

122125
.PHONY: e2e-coverage
123126
e2e-coverage:
@@ -167,6 +170,25 @@ OPM = $(shell which opm)
167170
endif
168171
endif
169172

173+
.PHONY: install-operator-sdk
174+
OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/v1.30.0
175+
export OS=$(shell go env GOOS)
176+
export ARCH=$(shell go env GOARCH)
177+
install-operator-sdk: ## Install operator-sdk
178+
if [ ! -f ~/bin/operator-sdk ]; then \
179+
curl -LO $(OPERATOR_SDK_DL_URL)/operator-sdk_${OS}_${ARCH} ; \
180+
chmod +x operator-sdk_${OS}_${ARCH} ; \
181+
mv operator-sdk_$(OS)_$(ARCH) /usr/local/bin/operator-sdk ; \
182+
fi
183+
184+
.PHONY: deploy-local-registry
185+
deploy-local-registry: ## Deploy local docker registry
186+
docker run -d -p 5000:5000 --restart=always --name local-registry registry:2
187+
188+
.PHONY: stop-local-registry
189+
stop-local-registry: ## Stop and remove local registry
190+
docker container stop local-registry && docker container rm -v local-registry
191+
170192
##@ Build
171193

172194
export VERSION ?= $(shell git describe --tags --always --dirty)

go.mod

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ require (
7272
github.com/google/gofuzz v1.2.0 // indirect
7373
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect
7474
github.com/google/uuid v1.3.0 // indirect
75+
github.com/gorilla/mux v1.8.0 // indirect
76+
github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 // indirect
7577
github.com/h2non/filetype v1.1.1 // indirect
7678
github.com/h2non/go-is-svg v0.0.0-20160927212452-35e8c4b0612c // indirect
7779
github.com/imdario/mergo v0.3.13 // indirect
@@ -91,7 +93,10 @@ require (
9193
github.com/modern-go/reflect2 v1.0.2 // indirect
9294
github.com/morikuni/aec v1.0.0 // indirect
9395
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
94-
github.com/operator-framework/api v0.17.3 // indirect
96+
github.com/opencontainers/go-digest v1.0.0 // indirect
97+
github.com/opencontainers/image-spec v1.1.0-rc2 // indirect
98+
github.com/operator-framework/api v0.17.4-0.20230223191600-0131a6301e42 // indirect
99+
github.com/otiai10/copy v1.2.0 // indirect
95100
github.com/pkg/errors v0.9.1 // indirect
96101
github.com/pmezard/go-difflib v1.0.0 // indirect
97102
github.com/prometheus/client_golang v1.14.0 // indirect

go.sum

Lines changed: 245 additions & 10 deletions
Large diffs are not rendered by default.

test/operator-e2e/README.md

Lines changed: 0 additions & 53 deletions
This file was deleted.

test/operator-e2e/config/catalog_config.yaml

Lines changed: 0 additions & 32 deletions
This file was deleted.

test/operator-e2e/config/read_config.go

Lines changed: 0 additions & 70 deletions
This file was deleted.

test/operator-e2e/create_fbc.go

Lines changed: 0 additions & 146 deletions
This file was deleted.

0 commit comments

Comments
 (0)