Remove redundancy in SyncPods

This commit is contained in:
Tim Hockin
2014-10-19 21:35:08 -07:00
parent 36a05ee871
commit 76c33a88b6
2 changed files with 8 additions and 13 deletions

View File

@@ -662,12 +662,7 @@ func (kl *Kubelet) SyncPods(pods []api.BoundPod) error {
}
// Kill any containers we don't need.
existingContainers, err := dockertools.GetKubeletDockerContainers(kl.dockerClient, false)
if err != nil {
glog.Errorf("Error listing containers: %s", err)
return err
}
for _, container := range existingContainers {
for _, container := range dockerContainers {
// Don't kill containers that are in the desired pods.
podFullName, uuid, containerName, _ := dockertools.ParseDockerName(container.Names[0])
pc := podContainer{podFullName, uuid, containerName}