mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
* Show runtimeClassName in pods view Signed-off-by: Piotr Roszatycki <piotr.roszatycki@gmail.com> * Runtime Classes view Signed-off-by: Piotr Roszatycki <piotr.roszatycki@gmail.com> * Reverted formatting Signed-off-by: Piotr Roszatycki <piotr.roszatycki@gmail.com> Signed-off-by: Piotr Roszatycki <piotr.roszatycki@gmail.com>
33 lines
1.1 KiB
TypeScript
33 lines
1.1 KiB
TypeScript
/**
|
|
* Copyright (c) OpenLens Authors. All rights reserved.
|
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
|
*/
|
|
|
|
import "./runtime-classes-details-tolerations.scss";
|
|
import React from "react";
|
|
import { DrawerParamToggler, DrawerItem } from "../drawer";
|
|
import type { Toleration, KubeObject } from "../../../common/k8s-api/kube-object";
|
|
import { RuntimeClassTolerations } from "./runtime-classes-tolerations";
|
|
|
|
export interface KubeObjectWithTolerations extends KubeObject {
|
|
getTolerations(): Toleration[];
|
|
}
|
|
|
|
export interface RuntimeClassDetailsTolerationsProps {
|
|
runtimeClass: KubeObjectWithTolerations;
|
|
}
|
|
|
|
export function RuntimeClassDetailsTolerations({ runtimeClass: runtimeClass }: RuntimeClassDetailsTolerationsProps) {
|
|
const tolerations = runtimeClass.getTolerations();
|
|
|
|
if (!tolerations.length) return null;
|
|
|
|
return (
|
|
<DrawerItem name="Tolerations" className="RuntimeClassDetailsTolerations">
|
|
<DrawerParamToggler label={tolerations.length}>
|
|
<RuntimeClassTolerations tolerations={tolerations} />
|
|
</DrawerParamToggler>
|
|
</DrawerItem>
|
|
);
|
|
}
|