Skip to content

Commit 6c32ce6

Browse files
committed
Add prometheus to e2e workflow
Signed-off-by: dtfranz <[email protected]>
1 parent 6d7af37 commit 6c32ce6

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

Makefile

+18
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,24 @@ test-e2e: KUSTOMIZE_BUILD_DIR := config/overlays/e2e
252252
test-e2e: GO_BUILD_EXTRA_FLAGS := -cover
253253
test-e2e: run image-registry e2e e2e-coverage kind-clean #HELP Run e2e test suite on local kind cluster
254254

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

0 commit comments

Comments
 (0)