mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 05:27:21 +00:00
Merge pull request #107845 from smarterclayton/wait_on_create
kubelet: If the container status is created, we are waiting
This commit is contained in:
commit
df98f75e93
@ -1641,12 +1641,8 @@ func (kl *Kubelet) convertToAPIContainerStatuses(pod *v1.Pod, podStatus *kubecon
|
|||||||
case cs.State == kubecontainer.ContainerStateRunning:
|
case cs.State == kubecontainer.ContainerStateRunning:
|
||||||
status.State.Running = &v1.ContainerStateRunning{StartedAt: metav1.NewTime(cs.StartedAt)}
|
status.State.Running = &v1.ContainerStateRunning{StartedAt: metav1.NewTime(cs.StartedAt)}
|
||||||
case cs.State == kubecontainer.ContainerStateCreated:
|
case cs.State == kubecontainer.ContainerStateCreated:
|
||||||
// Treat containers in the "created" state as if they are exited.
|
// containers that are created but not running are "waiting to be running"
|
||||||
// The pod workers are supposed start all containers it creates in
|
status.State.Waiting = &v1.ContainerStateWaiting{}
|
||||||
// one sync (syncPod) iteration. There should not be any normal
|
|
||||||
// "created" containers when the pod worker generates the status at
|
|
||||||
// the beginning of a sync iteration.
|
|
||||||
fallthrough
|
|
||||||
case cs.State == kubecontainer.ContainerStateExited:
|
case cs.State == kubecontainer.ContainerStateExited:
|
||||||
status.State.Terminated = &v1.ContainerStateTerminated{
|
status.State.Terminated = &v1.ContainerStateTerminated{
|
||||||
ExitCode: int32(cs.ExitCode),
|
ExitCode: int32(cs.ExitCode),
|
||||||
|
Loading…
Reference in New Issue
Block a user