1 parent eae996e commit 5191eacCopy full SHA for 5191eac
1 file changed
pkg/handlers/columns.go
@@ -22,6 +22,8 @@ import (
22
23
const defaultReplicaCount = int32(1)
24
25
+const nodeRoleLabelPrefix = "node-role.kubernetes.io/"
26
+
27
func labelToColumnHeader(label string) string {
28
parts := strings.Split(label, "/")
29
//nolint:mnd // common case to have prefix with slash
@@ -333,8 +335,8 @@ func getNodeStatus(node *v1.Node) string {
333
335
func getNodeRoles(node *v1.Node) string {
334
336
var roles []string
337
for key := range node.Labels {
- if strings.HasPrefix(key, "node-role.kubernetes.io/") {
- role := strings.TrimPrefix(key, "node-role.kubernetes.io/")
338
+ if strings.HasPrefix(key, nodeRoleLabelPrefix) {
339
+ role := strings.TrimPrefix(key, nodeRoleLabelPrefix)
340
if role != "" {
341
roles = append(roles, role)
342
}
0 commit comments