mirror of
https://github.com/skooner-k8s/skooner.git
synced 2026-05-20 06:32:44 +00:00
Removing some TODO types
This commit is contained in:
@@ -65,8 +65,8 @@ export function getNodeUsage(node: Node, metrics: _.Dictionary<Metrics>, resourc
|
||||
|
||||
// Pod helpers
|
||||
export function getPodResourcePercent(
|
||||
pod: Pod,
|
||||
metrics: _.Dictionary<Metrics>,
|
||||
pod: Pod | undefined,
|
||||
metrics: _.Dictionary<Metrics> | undefined,
|
||||
resource: ResourceType,
|
||||
type: string,
|
||||
) {
|
||||
@@ -75,7 +75,11 @@ export function getPodResourcePercent(
|
||||
return actual ? actual / request : null;
|
||||
}
|
||||
|
||||
export function getPodUsage(pod: Pod, metrics: _.Dictionary<Metrics>, resource: ResourceType) {
|
||||
export function getPodUsage(
|
||||
pod: Pod | undefined,
|
||||
metrics: _.Dictionary<Metrics> | undefined,
|
||||
resource: ResourceType,
|
||||
) {
|
||||
if (!pod || !metrics) return undefined;
|
||||
|
||||
const metric = metrics[pod.metadata.name] || {};
|
||||
|
||||
@@ -109,6 +109,10 @@ export interface K8sEvent extends ApiItem<undefined, undefined> {
|
||||
involvedObject: InvolvedObject;
|
||||
}
|
||||
|
||||
interface ContainerStatus {
|
||||
restartCount: number;
|
||||
}
|
||||
|
||||
interface PodSpec {
|
||||
nodeName: string;
|
||||
containers: Container[];
|
||||
@@ -122,6 +126,7 @@ interface PodStatus {
|
||||
qosClass: string;
|
||||
message: string;
|
||||
conditions?: Condition[];
|
||||
containerStatuses: ContainerStatus[];
|
||||
}
|
||||
|
||||
export interface Pod extends ApiItem<PodSpec, PodStatus>{
|
||||
|
||||
@@ -65,7 +65,8 @@ export function parseCpu(value?: string) {
|
||||
return number * 1000 * 1000 * 1000;
|
||||
}
|
||||
|
||||
export function unparseCpu(value: string) {
|
||||
export function unparseCpu(value: string | number) {
|
||||
// @ts-ignore
|
||||
const result = parseFloat(value);
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user