Commit 7c75f5c5 authored by Yu-Ju Hong's avatar Yu-Ju Hong

kuberuntime: report StartedAt for exited containers

parent 2cf01690
...@@ -402,9 +402,12 @@ func (m *kubeGenericRuntimeManager) getPodContainerStatuses(uid kubetypes.UID, n ...@@ -402,9 +402,12 @@ func (m *kubeGenericRuntimeManager) getPodContainerStatuses(uid kubetypes.UID, n
CreatedAt: time.Unix(0, status.CreatedAt), 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) cStatus.StartedAt = time.Unix(0, status.StartedAt)
} else { }
if c.State == runtimeapi.ContainerState_CONTAINER_EXITED {
cStatus.Reason = status.Reason cStatus.Reason = status.Reason
cStatus.Message = status.Message cStatus.Message = status.Message
cStatus.ExitCode = int(status.ExitCode) cStatus.ExitCode = int(status.ExitCode)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment