Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion dashboards/resources/variables/cluster.libsonnet
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet';
local var = g.dashboard.variable;
local common = import './common.libsonnet';

{
cluster(config)::
local datasource = common.datasource(config);
local clusterVar =
common.cluster(config, datasource, 'up{%(kubeStateMetricsSelector)s}')
+ var.query.generalOptions.showOnDashboard.withLabelAndValue();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this go on the common variable definition instead? Otherwise this will have to be copy/pasted every time it's used.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes! I'll update that

{
datasource: datasource,
cluster: common.cluster(config, datasource, 'up{%(cadvisorSelector)s}'),
cluster: clusterVar,
},
}