Skip to content

Commit f5aba6a

Browse files
committed
Run pre-commit and ignore vendored files
1 parent e957027 commit f5aba6a

File tree

3 files changed

+26
-27
lines changed

3 files changed

+26
-27
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@ repos:
33
rev: v0.20.0
44
hooks:
55
- id: jsonnet-format
6-
# jsonnet-lint hook doesn't work
7-
# - id: jsonnet-lint
6+
exclude: ^vendor/.*

dashboards/cluster.jsonnet

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Deploys a dashboard showing cluster-wide information
2-
local grafonnet = import "github.com/grafana/grafonnet/gen/grafonnet-v10.0.0/main.libsonnet";
2+
local grafonnet = import 'github.com/grafana/grafonnet/gen/grafonnet-v10.0.0/main.libsonnet';
33
local dashboard = grafonnet.dashboard;
44
local ts = grafonnet.panel.timeSeries;
55
local prometheus = grafonnet.query.prometheus;
@@ -19,30 +19,30 @@ local variables = [
1919
local userNodes = ts.new(
2020
'Node Count'
2121
) + ts.panelOptions.withDescription(
22-
"Number of nodes in each nodepool in this cluster"
22+
'Number of nodes in each nodepool in this cluster'
2323
) + ts.standardOptions.withMin(
2424
0
2525
) + ts.queryOptions.withTargets([
26-
prometheus.new(
27-
'$PROMETHEUS_DS',
28-
|||
29-
# sum up all nodes by nodepool
30-
sum(
31-
# kube_pod_labels comes from
32-
# https://github.com/kubernetes/kube-state-metrics, and there is a particular
33-
# label (kubernetes_node) that lists the node on which the kube-state-metrics pod
34-
# s running! So that's totally irrelevant to these queries, but when a nodepool
35-
# is rotated it caused there to exist two metrics with the same node value (which
36-
# we care about) but different kubernetes_node values (because kube-state-metrics
37-
# was running in a different node, even though we don't care about that). This
38-
# group really just drops all labels except the two we care about to
39-
# avoid messing things up.
40-
group(
41-
kube_node_labels
42-
) by (node, label_cloud_google_com_gke_nodepool)
43-
) by (label_cloud_google_com_gke_nodepool)
44-
|||
45-
) + prometheus.withLegendFormat('{{label_cloud_google_com_gke_nodepool}}')
26+
prometheus.new(
27+
'$PROMETHEUS_DS',
28+
|||
29+
# sum up all nodes by nodepool
30+
sum(
31+
# kube_pod_labels comes from
32+
# https://github.com/kubernetes/kube-state-metrics, and there is a particular
33+
# label (kubernetes_node) that lists the node on which the kube-state-metrics pod
34+
# s running! So that's totally irrelevant to these queries, but when a nodepool
35+
# is rotated it caused there to exist two metrics with the same node value (which
36+
# we care about) but different kubernetes_node values (because kube-state-metrics
37+
# was running in a different node, even though we don't care about that). This
38+
# group really just drops all labels except the two we care about to
39+
# avoid messing things up.
40+
group(
41+
kube_node_labels
42+
) by (node, label_cloud_google_com_gke_nodepool)
43+
) by (label_cloud_google_com_gke_nodepool)
44+
|||
45+
) + prometheus.withLegendFormat('{{label_cloud_google_com_gke_nodepool}}'),
4646
]);
4747

4848
local userPods = ts.new(
@@ -357,9 +357,9 @@ dashboard.new(
357357
userPods,
358358
// clusterMemoryCommitment,
359359
// clusterCPUCommitment,
360-
userNodes
360+
userNodes,
361361
362-
])
362+
]),
363363
// nonRunningPods,
364364
// row.new('Node Stats'),
365365
// nodeCPUUtil,

dashboards/jupyterhub.libsonnet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
local grafonnet = import "github.com/grafana/grafonnet/gen/grafonnet-v10.0.0/main.libsonnet";
1+
local grafonnet = import 'github.com/grafana/grafonnet/gen/grafonnet-v10.0.0/main.libsonnet';
22
local graphPanel = grafonnet.graphPanel;
33
local prometheus = grafonnet.prometheus;
44

0 commit comments

Comments
 (0)