kubelet: Introduce PodInfraContainerChanged().

This functions computes in ahead whether we need to restart the pod
infra container.
This commit is contained in:
Yifan Gu
2015-04-13 10:02:19 -07:00
parent 26f8bc1a68
commit d14cb8f1dd
3 changed files with 60 additions and 23 deletions

View File

@@ -222,9 +222,11 @@ func (f *FakeDockerClient) StopContainer(id string, timeout uint) error {
f.Stopped = append(f.Stopped, id)
var newList []docker.APIContainers
for _, container := range f.ContainerList {
if container.ID != id {
newList = append(newList, container)
if container.ID == id {
f.ExitedContainerList = append(f.ExitedContainerList, container)
continue
}
newList = append(newList, container)
}
f.ContainerList = newList
}