diff --git a/tests/prometheus/prometheus.yaml b/tests/prometheus/prometheus.yaml index a019b61ac8bf169c433bb950d0abc5132d6eab2e..e10f24abad215773ba0d109b09e2ff8db94dbb5c 100644 --- a/tests/prometheus/prometheus.yaml +++ b/tests/prometheus/prometheus.yaml @@ -21,7 +21,7 @@ tests: apiVersion: "monitoring.coreos.com/v1" name: it-monit-metrics-collector-prometheus not: true - - it: should be deployed with cluster-local remote write by default + - it: should be deployed with cluster-local remote write by default and k8s_cluster_name set set: kubernetes.clusterName: test asserts: @@ -35,6 +35,9 @@ tests: - equal: path: spec.remoteWrite[0].url value: "http://it-monit-metrics-fluentbit:8080/api/prom/push" + - equal: + path: spec.externalLabels.k8s_cluster_name + value: test - it: should be deployed with no remoteWrites if no fluentbit is available set: kubernetes.clusterName: test @@ -47,7 +50,7 @@ tests: - lengthEqual: path: spec.remoteWrite count: 0 - - it: should be deployed with external remote write if configured + - it: should be deployed with external remote write if configured and no external labels set: kubernetes.clusterName: test metrics.fluentbit.enabled: false @@ -70,6 +73,8 @@ tests: password: name: it-monit-metrics-collector-prometheus key: password + - isNullOrEmpty: + path: spec.externalLabels - lengthEqual: path: spec.remoteWrite count: 1