diff --git a/Makefile b/Makefile index 74ffb1e1e..d3c448ed4 100644 --- a/Makefile +++ b/Makefile @@ -109,7 +109,7 @@ e2e: KIND_CLUSTER_NAME=operator-controller-e2e e2e: run kind-load-test-artifacts test-e2e kind-cluster-cleanup ## Run e2e test suite on local kind cluster operator-developer-e2e: KIND_CLUSTER_NAME=operator-controller-e2e ## Run operator-developer e2e on local kind cluster -operator-developer-e2e: run opm test-operator-developer-e2e kind-cluster-cleanup +operator-developer-e2e: run opm install-operator-sdk deploy-local-registry test-operator-developer-e2e stop-local-registry kind-cluster-cleanup kind-load: $(KIND) ## Loads the currently constructed image onto the cluster $(KIND) load docker-image $(IMG) --name $(KIND_CLUSTER_NAME) @@ -147,6 +147,24 @@ OPM = $(shell which opm) endif endif +.PHONY: install-operator-sdk +OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/v1.30.0 +install-operator-sdk: ## Install operator-sdk + OS=$(shell go env GOOS) && ARCH=$(shell go env GOARCH) && \ + if [ ! -f ~/bin/operator-sdk ]; then \ + curl -LO $(OPERATOR_SDK_DL_URL)/operator-sdk_$${OS}_$${ARCH} ; \ + chmod +x operator-sdk_$${OS}_$${ARCH} ; \ + mv operator-sdk_$(OS)_$(ARCH) /usr/local/bin/operator-sdk ; \ + fi + +.PHONY: deploy-local-registry +deploy-local-registry: ## Deploy local docker registry + docker run -d -p 5000:5000 --restart=always --name local-registry registry:2 + +.PHONY: stop-local-registry +stop-local-registry: ## Stop and remove local registry + docker container stop local-registry && docker container rm -v local-registry + ##@ Build export VERSION ?= $(shell git describe --tags --always --dirty) diff --git a/test/operator-framework-e2e/operator_framework_test.go b/test/operator-framework-e2e/operator_framework_test.go index e2b0924a0..46067003a 100644 --- a/test/operator-framework-e2e/operator_framework_test.go +++ b/test/operator-framework-e2e/operator_framework_test.go @@ -73,7 +73,7 @@ type SdkProjectInfo struct { } const ( - remoteRegistryRepo = "docker.io/jubittajohn/" + remoteRegistryRepo = "localhost:5000/" kindServer = "operator-controller-e2e" opmPath = "../../bin/opm" deployedNameSpace = "rukpak-system" @@ -321,7 +321,7 @@ var _ = Describe("Operator Framework E2E for registry+v1 bundles", func() { Expect(err).ToNot(HaveOccurred()) By("Forming the FBC using semver") - cmd := exec.Command(opmPath, "alpha", "render-template", "semver", semverFileName, "-o", "yaml") + cmd := exec.Command(opmPath, "alpha", "render-template", "semver", semverFileName, "-o", "yaml", "--use-http") output, err := cmd.CombinedOutput() Expect(err).ToNot(HaveOccurred())