mirror of
https://github.com/skooner-k8s/skooner.git
synced 2026-05-21 07:02:44 +00:00
Converting Nodes, Node, Pods, and Pod to TS
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import {TODO} from './types';
|
||||
import {Node} from './types';
|
||||
|
||||
/**
|
||||
* @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}: TODO) {
|
||||
if (!status.conditions) return null;
|
||||
const ready = status.conditions.find((y: {type: string}) => y.type === 'Ready');
|
||||
function getReadyStatus({status}: Node) {
|
||||
if (!status.conditions) return undefined;
|
||||
const ready = status.conditions.find(y => y.type === 'Ready');
|
||||
return ready && ready.status;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user