mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Issue:926 - Added Last Status information for Container
- This update will support a last status of terminated and display the information for the termninated state. Signed-off-by: Steve Richards <srichards@mirantis.com>
This commit is contained in:
parent
44ce51613b
commit
888fa88754
@ -149,7 +149,16 @@ export interface IPodContainerStatus {
|
|||||||
reason: string;
|
reason: string;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
lastState: {};
|
lastState: {
|
||||||
|
[index: string]: object;
|
||||||
|
terminated?: {
|
||||||
|
startedAt: string;
|
||||||
|
finishedAt: string;
|
||||||
|
exitCode: number;
|
||||||
|
reason: string;
|
||||||
|
containerID: string;
|
||||||
|
};
|
||||||
|
};
|
||||||
ready: boolean;
|
ready: boolean;
|
||||||
restartCount: number;
|
restartCount: number;
|
||||||
image: string;
|
image: string;
|
||||||
|
|||||||
@ -27,6 +27,7 @@ export class PodDetailsContainer extends React.Component<Props> {
|
|||||||
const { name, image, imagePullPolicy, ports, volumeMounts, command, args } = container
|
const { name, image, imagePullPolicy, ports, volumeMounts, command, args } = container
|
||||||
const status = pod.getContainerStatuses().find(status => status.name === container.name)
|
const status = pod.getContainerStatuses().find(status => status.name === container.name)
|
||||||
const state = status ? Object.keys(status.state)[0] : ""
|
const state = status ? Object.keys(status.state)[0] : ""
|
||||||
|
const lastState = status ? Object.keys(status.lastState)[0] : ""
|
||||||
const ready = status ? status.ready : ""
|
const ready = status ? status.ready : ""
|
||||||
const liveness = pod.getLivenessProbe(container)
|
const liveness = pod.getLivenessProbe(container)
|
||||||
const readiness = pod.getReadinessProbe(container)
|
const readiness = pod.getReadinessProbe(container)
|
||||||
@ -54,6 +55,15 @@ export class PodDetailsContainer extends React.Component<Props> {
|
|||||||
</span>
|
</span>
|
||||||
</DrawerItem>
|
</DrawerItem>
|
||||||
}
|
}
|
||||||
|
{status &&
|
||||||
|
<DrawerItem name={<Trans>Last Status</Trans>}>
|
||||||
|
<span>
|
||||||
|
{lastState}{ready ? `, ${_i18n._(t`ready`)}` : ""}
|
||||||
|
{lastState === 'terminated' ? ` - ${status.lastState.terminated.reason} (${_i18n._(t`exit code`)}: ${status.lastState.terminated.exitCode}),
|
||||||
|
${_i18n._(t`started at`)}: ${status.lastState.terminated.startedAt}, ${_i18n._(t`finished at`)}: ${status.lastState.terminated.finishedAt}` : ''}
|
||||||
|
</span>
|
||||||
|
</DrawerItem>
|
||||||
|
}
|
||||||
<DrawerItem name={<Trans>Image</Trans>}>
|
<DrawerItem name={<Trans>Image</Trans>}>
|
||||||
{image}
|
{image}
|
||||||
</DrawerItem>
|
</DrawerItem>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user