From f01fd8ff385c6c4b0b2eb0f667c01012cda02691 Mon Sep 17 00:00:00 2001 From: Dawn Chen Date: Tue, 14 Oct 2014 10:26:31 -0700 Subject: [PATCH] After all containers in a pod started. If any one container is still running, or in the process of restarting, mark pod status running. Fix #1758. --- pkg/registry/pod/rest.go | 2 +- pkg/registry/pod/rest_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/registry/pod/rest.go b/pkg/registry/pod/rest.go index 13a77c40974..fae5f1c3721 100644 --- a/pkg/registry/pod/rest.go +++ b/pkg/registry/pod/rest.go @@ -311,7 +311,7 @@ func getPodStatus(pod *api.Pod, minions client.MinionInterface) (api.PodStatus, } } switch { - case running > 0 && stopped == 0 && unknown == 0: + case running > 0 && unknown == 0: return api.PodRunning, nil case running == 0 && stopped > 0 && unknown == 0: return api.PodTerminated, nil diff --git a/pkg/registry/pod/rest_test.go b/pkg/registry/pod/rest_test.go index a7db0396f35..b809a7580a5 100644 --- a/pkg/registry/pod/rest_test.go +++ b/pkg/registry/pod/rest_test.go @@ -496,7 +496,7 @@ func TestMakePodStatus(t *testing.T) { Host: "machine", }, }, - api.PodWaiting, + api.PodRunning, "mixed state #1", }, {