Skip to content

Commit

Permalink
Node labeller: add non-beta labels
Browse files Browse the repository at this point in the history
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
  • Loading branch information
y2kenny-amd committed Oct 19, 2024
1 parent 38eb5cc commit c0b0231
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cmd/k8s-node-labeller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@ func createLabels(kind string, entries map[string]int) map[string]string {
}
}

prefix = createLabelPrefix(kind, false)
for k, v := range entries {
if (len(entries) == 1) {
labels[prefix] = k
} else {
labels[fmt.Sprintf("%s.%s", prefix, k)] = strconv.Itoa(v)
}
}

return labels
}

Expand Down

0 comments on commit c0b0231

Please sign in to comment.