From 66e3a520e64c90dde37e7533a33f40d8bca22dfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20=C5=A0tibran=C3=BD?= Date: Wed, 19 May 2021 14:19:03 +0200 Subject: [PATCH] Only show namespaces from selected cluster. "All" works thanks to using regex matcher. (#311) * Only show namespaces from selected cluster. "All" works thanks to using regex matcher. * CHANGELOG.md --- CHANGELOG.md | 2 ++ cortex-mixin/dashboards/dashboard-utils.libsonnet | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 854dc3cd..002520fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## master / unreleased +* [CHANGE] `namespace` template variable in dashboards now only selects namespaces for selected clusters. #311 + ## 1.9.0 / 2021-05-18 * [CHANGE] Replace use of removed Cortex CLI flag `-querier.compress-http-responses` for query frontend with `-api.response-compression-enabled`. #299 diff --git a/cortex-mixin/dashboards/dashboard-utils.libsonnet b/cortex-mixin/dashboards/dashboard-utils.libsonnet index f79c27af..1ba99603 100644 --- a/cortex-mixin/dashboards/dashboard-utils.libsonnet +++ b/cortex-mixin/dashboards/dashboard-utils.libsonnet @@ -36,13 +36,13 @@ local utils = import 'mixin-utils/utils.libsonnet'; then d.addMultiTemplate('job', 'cortex_build_info', 'job') else d .addMultiTemplate('cluster', 'cortex_build_info', 'cluster') - .addMultiTemplate('namespace', 'cortex_build_info', 'namespace') + .addMultiTemplate('namespace', 'cortex_build_info{cluster=~"$cluster"}', 'namespace') else if $._config.singleBinary then d.addTemplate('job', 'cortex_build_info', 'job') else d .addTemplate('cluster', 'cortex_build_info', 'cluster') - .addTemplate('namespace', 'cortex_build_info', 'namespace'), + .addTemplate('namespace', 'cortex_build_info{cluster=~"$cluster"}', 'namespace'), },