mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-05 02:09:56 +00:00
kuberuntime: report StartedAt for exited containers
This commit is contained in:
parent
2cf0169092
commit
7c75f5c551
@ -402,9 +402,12 @@ func (m *kubeGenericRuntimeManager) getPodContainerStatuses(uid kubetypes.UID, n
|
||||
CreatedAt: time.Unix(0, status.CreatedAt),
|
||||
}
|
||||
|
||||
if c.State == runtimeapi.ContainerState_CONTAINER_RUNNING {
|
||||
if c.State != runtimeapi.ContainerState_CONTAINER_CREATED {
|
||||
// If container is not in the created state, we have tried and
|
||||
// started the container. Set the StartedAt time.
|
||||
cStatus.StartedAt = time.Unix(0, status.StartedAt)
|
||||
} else {
|
||||
}
|
||||
if c.State == runtimeapi.ContainerState_CONTAINER_EXITED {
|
||||
cStatus.Reason = status.Reason
|
||||
cStatus.Message = status.Message
|
||||
cStatus.ExitCode = int(status.ExitCode)
|
||||
|
Loading…
Reference in New Issue
Block a user