Skip to content

Commit

Permalink
Added make target to install operator-sdk; Added make target to deplo…
Browse files Browse the repository at this point in the history
…y a local registry server; Changed test to use the local registry server

Signed-off-by: jubittajohn <jujohn@redhat.com>
  • Loading branch information
jubittajohn committed Jul 27, 2023
1 parent 0ae996e commit d57d09e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
20 changes: 19 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions test/operator-framework-e2e/operator_framework_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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())

Expand Down

0 comments on commit d57d09e

Please sign in to comment.