Converting Nodes, Node, Pods, and Pod to TS

This commit is contained in:
Eric Herbrandson
2020-08-09 18:26:49 -05:00
parent a71ce9a620
commit cca2f33c86
24 changed files with 245 additions and 124 deletions

View File

@@ -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;
}