|
25 | 25 | export IMAGE_TAG
|
26 | 26 |
|
27 | 27 | IMG := $(IMAGE_REPO):$(IMAGE_TAG)
|
| 28 | +CATALOGD_IMG := $(CATALOG_IMAGE_REPO):$(IMAGE_TAG) |
28 | 29 |
|
29 | 30 | # Define dependency versions (use go.mod if we also use Go code from dependency)
|
30 | 31 | export CERT_MGR_VERSION := v1.15.3
|
@@ -64,12 +65,15 @@ $(warning Could not find docker or podman in path! This may result in targets re
|
64 | 65 | endif
|
65 | 66 |
|
66 | 67 | KUSTOMIZE_BUILD_DIR := config/overlays/cert-manager
|
| 68 | +CATALOGD_KUSTOMIZE_BUILD_DIR := catalogd/config/overlays/cert-manager |
67 | 69 |
|
68 | 70 | # Disable -j flag for make
|
69 | 71 | .NOTPARALLEL:
|
70 | 72 |
|
71 | 73 | .DEFAULT_GOAL := build
|
72 | 74 |
|
| 75 | +GINKGO := go run github.com/onsi/ginkgo/v2/ginkgo |
| 76 | + |
73 | 77 | #SECTION General
|
74 | 78 |
|
75 | 79 | # The help target prints out all targets with their descriptions organized
|
@@ -209,6 +213,23 @@ test-e2e: KUSTOMIZE_BUILD_DIR := config/overlays/e2e
|
209 | 213 | test-e2e: GO_BUILD_FLAGS := -cover
|
210 | 214 | test-e2e: run image-registry e2e e2e-coverage kind-clean #HELP Run e2e test suite on local kind cluster
|
211 | 215 |
|
| 216 | +# Catalogd e2e tests |
| 217 | +FOCUS := $(if $(TEST),-v -focus "$(TEST)") |
| 218 | +ifeq ($(origin E2E_FLAGS), undefined) |
| 219 | +E2E_FLAGS := |
| 220 | +endif |
| 221 | +test-catalogd-e2e: ## Run the e2e tests on existing cluster |
| 222 | + $(GINKGO) $(E2E_FLAGS) -trace -vv $(FOCUS) test/catalogd-e2e |
| 223 | + |
| 224 | +catalogd-e2e: KIND_CLUSTER_NAME := catalogd-e2e |
| 225 | +catalogd-e2e: ISSUER_KIND := Issuer |
| 226 | +catalogd-e2e: ISSUER_NAME := selfsigned-issuer |
| 227 | +catalogd-e2e: CATALOGD_KUSTOMIZE_BUILD_DIR := catalogd/config/overlays/e2e |
| 228 | +catalogd-e2e: run catalogd-image-registry test-catalogd-e2e ## kind-clean Run e2e test suite on local kind cluster |
| 229 | + |
| 230 | +catalogd-image-registry: ## Setup in-cluster image registry |
| 231 | + ./test/tools/imageregistry/registry.sh $(ISSUER_KIND) $(ISSUER_NAME) |
| 232 | + |
212 | 233 | .PHONY: extension-developer-e2e
|
213 | 234 | extension-developer-e2e: KUSTOMIZE_BUILD_DIR := config/overlays/cert-manager
|
214 | 235 | extension-developer-e2e: KIND_CLUSTER_NAME := operator-controller-ext-dev-e2e #EXHELP Run extension-developer e2e on local kind cluster
|
@@ -246,10 +267,9 @@ kind-load: $(KIND) #EXHELP Loads the currently constructed images into the KIND
|
246 | 267 | kind-deploy: export MANIFEST := ./operator-controller.yaml
|
247 | 268 | kind-deploy: export DEFAULT_CATALOG := ./catalogd/config/base/default/clustercatalogs/default-catalogs.yaml
|
248 | 269 | kind-deploy: manifests $(KUSTOMIZE)
|
249 |
| - ($(KUSTOMIZE) build $(KUSTOMIZE_BUILD_DIR) && echo "---" && $(KUSTOMIZE) build catalogd/config/overlays/cert-manager | sed "s/cert-git-version/cert-$(VERSION)/g") > $(MANIFEST) |
| 270 | + ($(KUSTOMIZE) build $(KUSTOMIZE_BUILD_DIR) && echo "---" && $(KUSTOMIZE) build $(CATALOGD_KUSTOMIZE_BUILD_DIR) | sed "s/cert-git-version/cert-$(VERSION)/g") > $(MANIFEST) |
250 | 271 | envsubst '$$DEFAULT_CATALOG,$$CERT_MGR_VERSION,$$INSTALL_DEFAULT_CATALOGS,$$MANIFEST' < scripts/install.tpl.sh | bash -s
|
251 | 272 |
|
252 |
| - |
253 | 273 | .PHONY: kind-cluster
|
254 | 274 | kind-cluster: $(KIND) #EXHELP Standup a kind cluster.
|
255 | 275 | -$(KIND) delete cluster --name $(KIND_CLUSTER_NAME)
|
@@ -302,7 +322,13 @@ go-build-linux: export GOARCH=amd64
|
302 | 322 | go-build-linux: $(BINARIES)
|
303 | 323 |
|
304 | 324 | .PHONY: run
|
305 |
| -run: docker-build kind-cluster kind-load kind-deploy #HELP Build the operator-controller then deploy it into a new kind cluster. |
| 325 | +run: generate docker-build kind-cluster kind-load kind-deploy wait #HELP Build the operator-controller then deploy it into a new kind cluster. |
| 326 | + |
| 327 | +CATALOGD_NAMESPACE := olmv1-system |
| 328 | +wait: |
| 329 | + kubectl wait --for=condition=Available --namespace=$(CATALOGD_NAMESPACE) deployment/catalogd-controller-manager --timeout=60s |
| 330 | + kubectl wait --for=condition=Ready --namespace=$(CATALOGD_NAMESPACE) certificate/catalogd-service-cert # Avoid upgrade test flakes when reissuing cert |
| 331 | + |
306 | 332 |
|
307 | 333 | .PHONY: docker-build
|
308 | 334 | docker-build: build-linux #EXHELP Build docker image for operator-controller and catalog with GOOS=linux and local GOARCH.
|
|
0 commit comments