mirror of
https://github.com/skooner-k8s/skooner.git
synced 2026-05-14 11:46:51 +00:00
Add utils/nodeHelpers.js to provide some Node related utility functions
This commit is contained in:
11
client/src/utils/nodeHelpers.js
Normal file
11
client/src/utils/nodeHelpers.js
Normal 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;
|
||||
Reference in New Issue
Block a user