From 840fa540cf240dae2ce90bec58b08aaf3e1c64a2 Mon Sep 17 00:00:00 2001 From: Yang Le Date: Tue, 26 Sep 2023 11:41:54 +0800 Subject: [PATCH] move cluster lifecycle service monitor to component namespace Signed-off-by: Yang Le --- controllers/backplaneconfig_controller_test.go | 4 ++-- .../cluster-lifecycle/templates/metrics-servicemonitor.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/controllers/backplaneconfig_controller_test.go b/controllers/backplaneconfig_controller_test.go index 1ecc3f42..5c57e95f 100644 --- a/controllers/backplaneconfig_controller_test.go +++ b/controllers/backplaneconfig_controller_test.go @@ -447,7 +447,7 @@ var _ = Describe("BackplaneConfig controller", func() { ctx := context.Background() u := &unstructured.Unstructured{} u.SetName("clusterlifecycle-state-metrics-v2") - u.SetNamespace("openshift-monitoring") + u.SetNamespace(DestinationNamespace) u.SetGroupVersionKind(schema.GroupVersionKind{ Group: "monitoring.coreos.com", Kind: "ServiceMonitor", @@ -459,7 +459,7 @@ var _ = Describe("BackplaneConfig controller", func() { ctx := context.Background() namespacedName := types.NamespacedName{ Name: "clusterlifecycle-state-metrics-v2", - Namespace: "openshift-monitoring", + Namespace: DestinationNamespace, } resourceType := &monitoringv1.ServiceMonitor{} return k8sClient.Get(ctx, namespacedName, resourceType) diff --git a/pkg/templates/charts/toggle/cluster-lifecycle/templates/metrics-servicemonitor.yaml b/pkg/templates/charts/toggle/cluster-lifecycle/templates/metrics-servicemonitor.yaml index 5598d300..b7f3dafb 100644 --- a/pkg/templates/charts/toggle/cluster-lifecycle/templates/metrics-servicemonitor.yaml +++ b/pkg/templates/charts/toggle/cluster-lifecycle/templates/metrics-servicemonitor.yaml @@ -4,7 +4,7 @@ apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: name: clusterlifecycle-state-metrics-v2 - namespace: openshift-monitoring + namespace: {{ .Values.global.namespace }} spec: endpoints: - interval: 60s