Skip to content

Commit b39378b

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 f9cc878 commit b39378b

File tree

14 files changed

+1527
-833
lines changed

14 files changed

+1527
-833
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
name: operator-framework-e2e
1+
name: operator-developer-e2e
22

33
on:
44
workflow_dispatch:
55
pull_request:
66
push:
77
branches:
8-
- operator-framework-e2e
8+
- main
99

1010
jobs:
11-
e2e-kind:
11+
operator-developer-e2e:
1212
runs-on: ubuntu-latest
1313
steps:
1414

@@ -20,4 +20,4 @@ jobs:
2020

2121
- name: Run the operator framework e2e test
2222
run: |
23-
make operator-framework-e2e
23+
make operator-developer-e2e

Makefile

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ E2E_FLAGS ?= ""
9797
test-e2e: $(GINKGO) ## Run the e2e tests
9898
$(GINKGO) --tags $(GO_BUILD_TAGS) $(E2E_FLAGS) -trace -progress $(FOCUS) test/e2e
9999

100-
test-operator-framework-e2e: $(GINKGO) ## Run operator create, upgrade and delete tests
101-
$(GINKGO) --tags $(GO_BUILD_TAGS) $(E2E_FLAGS) -trace -progress test/operator-e2e
100+
test-operator-developer-e2e: $(GINKGO) ## Run operator create, upgrade and delete tests
101+
$(GINKGO) --tags $(GO_BUILD_TAGS) $(E2E_FLAGS) -trace -progress test/operator-framework-e2e
102102

103103
ENVTEST_VERSION = $(shell go list -m k8s.io/client-go | cut -d" " -f2 | sed 's/^v0\.\([[:digit:]]\{1,\}\)\.[[:digit:]]\{1,\}$$/1.\1.x/')
104104
UNIT_TEST_DIRS=$(shell go list ./... | grep -v /test/)
@@ -108,8 +108,8 @@ test-unit: $(SETUP_ENVTEST) ## Run the unit tests
108108
e2e: KIND_CLUSTER_NAME=operator-controller-e2e
109109
e2e: run kind-load-test-artifacts test-e2e kind-cluster-cleanup ## Run e2e test suite on local kind cluster
110110

111-
operator-framework-e2e: KIND_CLUSTER_NAME=operator-controller-e2e ## Run operator-framework e2e on local kind cluster
112-
operator-framework-e2e: run opm test-operator-framework-e2e kind-cluster-cleanup
111+
operator-developer-e2e: KIND_CLUSTER_NAME=operator-controller-e2e ## Run operator-developer e2e on local kind cluster
112+
operator-developer-e2e: run opm install-operator-sdk deploy-local-registry test-operator-developer-e2e stop-local-registry kind-cluster-cleanup
113113

114114
kind-load: $(KIND) ## Loads the currently constructed image onto the cluster
115115
$(KIND) load docker-image $(IMG) --name $(KIND_CLUSTER_NAME)
@@ -147,6 +147,25 @@ OPM = $(shell which opm)
147147
endif
148148
endif
149149

150+
.PHONY: install-operator-sdk
151+
OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/v1.30.0
152+
export OS=$(shell go env GOOS)
153+
export ARCH=$(shell go env GOARCH)
154+
install-operator-sdk: ## Install operator-sdk
155+
if [ ! -f ~/bin/operator-sdk ]; then \
156+
curl -LO $(OPERATOR_SDK_DL_URL)/operator-sdk_${OS}_${ARCH} ; \
157+
chmod +x operator-sdk_${OS}_${ARCH} ; \
158+
mv operator-sdk_$(OS)_$(ARCH) /usr/local/bin/operator-sdk ; \
159+
fi
160+
161+
.PHONY: deploy-local-registry
162+
deploy-local-registry: ## Deploy local docker registry
163+
docker run -d -p 5000:5000 --restart=always --name local-registry registry:2
164+
165+
.PHONY: stop-local-registry
166+
stop-local-registry: ## Stop and remove local registry
167+
docker container stop local-registry && docker container rm -v local-registry
168+
150169
##@ Build
151170

152171
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)