Add utils/nodeHelpers.js to provide some Node related utility functions

This commit is contained in:
Olivier
2020-04-30 17:10:15 +02:00
parent c285b91264
commit 52174e8751
3 changed files with 14 additions and 11 deletions

View File

@@ -0,0 +1,11 @@
/**
* @param {*status* object with a status field (most likely the row from the TableBody)}
* @returns the status text, as defined in https://kubernetes.io/docs/concepts/architecture/nodes/#condition
*/
function getReadyStatus({status}) {
if (!status.conditions) return null;
const ready = status.conditions.find(y => y.type === 'Ready');
return ready && ready.status;
}
export default getReadyStatus;