Use lodash _.has to check the master label in MetadataColumns

This commit is contained in:
Olivier
2020-02-02 08:09:27 +01:00
parent fb748e584b
commit 517f2ff0db

View File

@@ -72,8 +72,8 @@ export function MetadataColumns({item, href, includeNamespace, resourceClass}) {
/>
<div className='td_iconLabel'>{item.kind}</div>
{/** If the node is a master, display a simple "MASTER" label below the item.kind icon */}
{item.metadata.labels && Object.entries(item.metadata.labels).some(([key, _]) => key === "node-role.kubernetes.io/master")
{/** If the node is a master, display a simple "MASTER" label below the item.kind icon */
_.has(item.metadata.labels, ['node-role.kubernetes.io/master'])
&& <span className='td_iconLabel node-master'>MASTER</span>}
</td>