diff --git a/frontend/src/components/common/Resource/Resource.tsx b/frontend/src/components/common/Resource/Resource.tsx index 563761d462..7df8ad6d77 100644 --- a/frontend/src/components/common/Resource/Resource.tsx +++ b/frontend/src/components/common/Resource/Resource.tsx @@ -850,7 +850,13 @@ export function ContainersSection(props: { resource: KubeObjectInterface | null return resource?.spec?.initContainers || []; } - function getStatuses() { + function getEphemeralContainers() { + return resource?.spec?.ephemeralContainers || []; + } + + function getStatuses( + statusKind: 'containerStatuses' | 'initContainerStatuses' | 'ephemeralContainerStatuses' + ) { if (!resource || resource.kind !== 'Pod') { return {}; } @@ -859,7 +865,7 @@ export function ContainersSection(props: { resource: KubeObjectInterface | null [key: string]: ContainerInfoProps['status']; } = {}; - ((resource as KubePod).status.containerStatuses || []).forEach(containerStatus => { + ((resource as KubePod).status[statusKind] || []).forEach(containerStatus => { const { name, ...status } = containerStatus; statuses[name] = { ...status }; }); @@ -869,7 +875,10 @@ export function ContainersSection(props: { resource: KubeObjectInterface | null const containers = getContainers(); const initContainers = getInitContainers(); - const statuses = getStatuses(); + const ephemContainers = getEphemeralContainers(); + const statuses = getStatuses('containerStatuses'); + const initStatuses = getStatuses('initContainerStatuses'); + const ephemStatuses = getStatuses('ephemeralContainerStatuses'); const numContainers = containers.length; return ( @@ -889,6 +898,19 @@ export function ContainersSection(props: { resource: KubeObjectInterface | null )} + {ephemContainers.length > 0 && ( + + {ephemContainers.map((ephemContainer: KubeContainer) => ( + + ))} + + )} + {initContainers.length > 0 && ( {initContainers.map((initContainer: KubeContainer, i: number) => ( @@ -896,7 +918,7 @@ export function ContainersSection(props: { resource: KubeObjectInterface | null key={`init_container_${i}`} resource={resource} container={initContainer} - status={statuses[initContainer.name]} + status={initStatuses[initContainer.name]} /> ))} diff --git a/frontend/src/components/pod/__snapshots__/PodDetails.stories.storyshot b/frontend/src/components/pod/__snapshots__/PodDetails.stories.storyshot index 111860b1ad..8df522f0b5 100644 --- a/frontend/src/components/pod/__snapshots__/PodDetails.stories.storyshot +++ b/frontend/src/components/pod/__snapshots__/PodDetails.stories.storyshot @@ -1794,6 +1794,45 @@ exports[`Storyshots Pod/PodDetailsView Initializing 1`] = ` > init-myservice +
+ Status +
+
+ + Running + +
+
+ Restart Count +
+
+ 0 +
+
+ Container ID +
+
+ + containerd://5fd564933040cc489ad0774b3f4d99866547cfef02a5277d7459a0fc800c9307 + +
@@ -1821,6 +1860,18 @@ exports[`Storyshots Pod/PodDetailsView Initializing 1`] = ` > busybox

+

+ + ID: + + + docker.io/library/busybox@sha256:125113b35efe765c89a8ed49593e719532318d26828c58e26b26dd7c4c28a673 +

init-mydb
+
+ Status +
+
+ + Waiting (PodInitializing) + +
+
+ Restart Count +
+
+ 0 +
+
+ Container ID +
+
@@ -1876,6 +1960,7 @@ exports[`Storyshots Pod/PodDetailsView Initializing 1`] = ` > busybox

+