Skip to content

Commit 8f73fdc

Browse files
authored
🚦 color container if pod is pending
🚦 color container if pod is pending
2 parents 3f38689 + 17ff489 commit 8f73fdc

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

cyclops-ui/src/components/k8s-resources/Deployment.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -254,11 +254,15 @@ const Deployment = ({ name, namespace }: Props) => {
254254
dataIndex="containers"
255255
key="containers"
256256
width="15%"
257-
render={(containers) => (
257+
render={(containers, record: any) => (
258258
<>
259259
{containers.map((container: any) => {
260260
let color = container.status.running ? "green" : "red";
261261

262+
if (record.podPhase === "Pending") {
263+
color = "yellow"
264+
}
265+
262266
return (
263267
<Tag
264268
color={color}

cyclops-ui/src/components/k8s-resources/StatefulSet.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,13 @@ const StatefulSet = ({ name, namespace }: Props) => {
256256
width="15%"
257257
render={(containers) => (
258258
<>
259-
{containers.map((container: any) => {
259+
{containers.map((container: any, record: any) => {
260260
let color = container.status.running ? "green" : "red";
261261

262+
if (record.podPhase === "Pending") {
263+
color = "yellow"
264+
}
265+
262266
return (
263267
<Tag
264268
color={color}

cyclops-ui/src/utils/pods.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { formatDistanceToNow } from "date-fns";
22

33
export function formatPodAge(podAge: string): string {
4-
if (podAge === "") {
4+
if (podAge === null || podAge === "") {
55
return "";
66
}
77

0 commit comments

Comments
 (0)