Skip to content

Commit 2daa74b

Browse files
committed
Add prometheus to e2e workflow
Signed-off-by: dtfranz <[email protected]>
1 parent d41ddd0 commit 2daa74b

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

Makefile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,24 @@ test-e2e: KUSTOMIZE_BUILD_DIR := config/overlays/e2e
258258
test-e2e: GO_BUILD_EXTRA_FLAGS := -cover
259259
test-e2e: run image-registry e2e e2e-coverage kind-clean #HELP Run e2e test suite on local kind cluster
260260

261+
.PHONY: test-e2e-metrics
262+
test-e2e-metrics: KIND_CLUSTER_NAME := operator-controller-e2e
263+
test-e2e-metrics: KUSTOMIZE_BUILD_DIR := config/overlays/e2e
264+
test-e2e-metrics: GO_BUILD_EXTRA_FLAGS := -cover
265+
test-e2e-metrics: run image-registry prometheus e2e e2e-coverage kind-clean #HELP Run e2e test suite on local kind cluster with prometheus installed
266+
267+
.PHONY: prometheus
268+
prometheus: PROMETHEUS_NAMESPACE := prometheus
269+
prometheus: TMPDIR := $(shell mktemp -d)
270+
prometheus: LATEST := $(shell curl -s https://api.github.com/repos/prometheus-operator/prometheus-operator/releases/latest | jq -cr .tag_name)
271+
prometheus: ## Deploy Prometheus into 'prometheus' namespace
272+
trap 'echo "Cleaning up $(TMPDIR)"; rm -rf "$(TMPDIR)"' EXIT; \
273+
kubectl create ns $(PROMETHEUS_NAMESPACE); \
274+
curl -s "https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/refs/tags/$(LATEST)/kustomization.yaml" > "$(TMPDIR)/kustomization.yaml" ; \
275+
curl -s "https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/refs/tags/$(LATEST)/bundle.yaml" > "$(TMPDIR)/bundle.yaml" ; \
276+
(cd $(TMPDIR) && $(KUSTOMIZE) edit set namespace $(PROMETHEUS_NAMESPACE)) && kubectl create -k "$(TMPDIR)" ; \
277+
kubectl wait --for=condition=Ready pods -n $(PROMETHEUS_NAMESPACE) -l app.kubernetes.io/name=prometheus-operator
278+
261279
.PHONY: extension-developer-e2e
262280
extension-developer-e2e: KUSTOMIZE_BUILD_DIR := config/overlays/cert-manager
263281
extension-developer-e2e: KIND_CLUSTER_NAME := operator-controller-ext-dev-e2e

0 commit comments

Comments
 (0)