Skip to content

Commit c0b0231

Browse files
committed
Node labeller: add non-beta labels
The non-beta label's format will depend on the node setup. If the node has different type of GPUs, the labels will have a count as the value. If the node only has one type of GPU, the label with has the attribute as the value. The beta labels use both format. Change-Id: I3292b5069e2e3c03fe0b5a047b710ce0d1d09949
1 parent 38eb5cc commit c0b0231

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

cmd/k8s-node-labeller/main.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,15 @@ func createLabels(kind string, entries map[string]int) map[string]string {
4949
}
5050
}
5151

52+
prefix = createLabelPrefix(kind, false)
53+
for k, v := range entries {
54+
if (len(entries) == 1) {
55+
labels[prefix] = k
56+
} else {
57+
labels[fmt.Sprintf("%s.%s", prefix, k)] = strconv.Itoa(v)
58+
}
59+
}
60+
5261
return labels
5362
}
5463

0 commit comments

Comments
 (0)