1
0
mirror of https://github.com/lensapp/lens.git synced 2024-12-11 09:03:28 +03:00

Support kubernetes.io/role label for node roles (#155)

Signed-off-by: fernandocarletti <contato@fernandocarletti.net>
This commit is contained in:
Fernando Carletti 2020-03-26 12:43:01 -06:00 committed by GitHub
parent 4ead24bd9d
commit bef538c586
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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(", ")
}