Skip to content

Commit

Permalink
Support kubernetes.io/role label for node roles (#155)
Browse files Browse the repository at this point in the history
Signed-off-by: fernandocarletti <contato@fernandocarletti.net>
  • Loading branch information
fernandocarletti authored Mar 26, 2020
1 parent 4ead24b commit bef538c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions dashboard/client/api/endpoints/nodes.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@ export class Node extends KubeObject {
const roleLabels = Object.keys(this.metadata.labels).filter(key =>
key.includes("node-role.kubernetes.io")
).map(key => key.match(/([^/]+$)/)[0]) // all after last slash

if (this.metadata.labels["kubernetes.io/role"] != undefined) {
roleLabels.push(this.metadata.labels["kubernetes.io/role"])
}

return roleLabels.join(", ")
}

Expand Down

0 comments on commit bef538c

Please # to comment.