From 2395c1a726c5523620641ad69ef37a94dfb04efe Mon Sep 17 00:00:00 2001 From: Gabriel Mainberger Date: Fri, 2 Jun 2023 14:07:19 +0200 Subject: [PATCH] Revert "Change monitoring labels for Prometheus" This reverts commit 519bfa0e6ecd57059be6ab9c5aca19cf32dcdd80. --- component/main.jsonnet | 22 +++++-------------- .../builtin/builtin/builtin/00_namespace.yaml | 1 + 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/component/main.jsonnet b/component/main.jsonnet index 42acd384..1b81e1de 100644 --- a/component/main.jsonnet +++ b/component/main.jsonnet @@ -3,26 +3,16 @@ local k8up = import 'lib/backup-k8up.libjsonnet'; local com = import 'lib/commodore.libjsonnet'; local kap = import 'lib/kapitan.libjsonnet'; local kube = import 'lib/kube.libjsonnet'; -local prometheus = import 'lib/prometheus.libjsonnet'; local inv = kap.inventory(); // The hiera parameters for the component local params = inv.parameters.keycloak; -local namespace = ( - if params.monitoring.enabled && std.member(inv.applications, 'prometheus') then - prometheus.RegisterNamespace(kube.Namespace(params.namespace)) - else if params.monitoring.enabled && inv.parameters.facts.distribution == 'openshift4' then - kube.Namespace(params.namespace) { - metadata+: { - labels+: { 'openshift.io/cluster-monitoring': 'true' }, - }, - } - else - kube.Namespace(params.namespace) -) { - metadata+: { - labels+: com.makeMergeable(params.namespaceLabels), - }, +local namespace = kube.Namespace(params.namespace) { + metadata+: { + labels+: { + SYNMonitoring: 'main', + } + com.makeMergeable(params.namespaceLabels), + }, }; local networkpolicy_infinispan_labels = { diff --git a/tests/golden/builtin/builtin/builtin/00_namespace.yaml b/tests/golden/builtin/builtin/builtin/00_namespace.yaml index 41ecf15e..8e308acb 100644 --- a/tests/golden/builtin/builtin/builtin/00_namespace.yaml +++ b/tests/golden/builtin/builtin/builtin/00_namespace.yaml @@ -3,6 +3,7 @@ kind: Namespace metadata: annotations: {} labels: + SYNMonitoring: main name: syn-builtin test: testing name: syn-builtin