1
0
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:
Steve Richards 2020-10-07 10:35:14 +01:00
parent 44ce51613b
commit 888fa88754
2 changed files with 20 additions and 1 deletions

View File

@ -149,7 +149,16 @@ export interface IPodContainerStatus {
reason: string;
};
};
lastState: {};
lastState: {
[index: string]: object;
terminated?: {
startedAt: string;
finishedAt: string;
exitCode: number;
reason: string;
containerID: string;
};
};
ready: boolean;
restartCount: number;
image: string;

View File

@ -27,6 +27,7 @@ export class PodDetailsContainer extends React.Component<Props> {
const { name, image, imagePullPolicy, ports, volumeMounts, command, args } = container
const status = pod.getContainerStatuses().find(status => status.name === container.name)
const state = status ? Object.keys(status.state)[0] : ""
const lastState = status ? Object.keys(status.lastState)[0] : ""
const ready = status ? status.ready : ""
const liveness = pod.getLivenessProbe(container)
const readiness = pod.getReadinessProbe(container)
@ -54,6 +55,15 @@ export class PodDetailsContainer extends React.Component<Props> {
</span>
</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>}>
{image}
</DrawerItem>