Skip to content

Commit d8a8fc2

Browse files
feat: use showMultiCluster instead of cluster label
1 parent 1122d94 commit d8a8fc2

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

alerts/kube_apiserver.libsonnet

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ local utils = import '../lib/utils.libsonnet';
6161
annotations: {
6262
description: 'A client certificate used to authenticate to kubernetes apiserver is expiring in less than %s%s.' % [
6363
(utils.humanizeSeconds($._config.certExpirationWarningSeconds)),
64-
utils.ifClusterLabelSet($._config, ' on cluster {{ $labels.%(clusterLabel)s }}' % $._config),
64+
utils.ifShowMultiCluster($._config, ' on cluster {{ $labels.%(clusterLabel)s }}' % $._config),
6565
],
6666
summary: 'Client certificate is about to expire.',
6767
},
@@ -80,7 +80,7 @@ local utils = import '../lib/utils.libsonnet';
8080
annotations: {
8181
description: 'A client certificate used to authenticate to kubernetes apiserver is expiring in less than %s%s.' % [
8282
(utils.humanizeSeconds($._config.certExpirationCriticalSeconds)),
83-
utils.ifClusterLabelSet($._config, ' on cluster {{ $labels.%(clusterLabel)s }}' % $._config),
83+
utils.ifShowMultiCluster($._config, ' on cluster {{ $labels.%(clusterLabel)s }}' % $._config),
8484
],
8585
summary: 'Client certificate is about to expire.',
8686
},

lib/utils.libsonnet

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
},
5858
},
5959

60-
// if clusterLabel is set, return the string, otherwise return an empty string
61-
ifClusterLabelSet(config, string)::
62-
if std.length(config.clusterLabel) > 0 then string else '',
60+
// if showMultiCluster is true in config, return the string, otherwise return an empty string
61+
ifShowMultiCluster(config, string)::
62+
if config.showMultiCluster then string else '',
6363
}

0 commit comments

Comments
 (0)