From 1018d32d4f3c6d779f8793271ccc660639fbe3b8 Mon Sep 17 00:00:00 2001 From: Lantao Liu Date: Thu, 12 Nov 2015 15:30:14 -0800 Subject: [PATCH] Deprecate old containers without TerminationMessagePath label --- pkg/kubelet/dockertools/manager.go | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/pkg/kubelet/dockertools/manager.go b/pkg/kubelet/dockertools/manager.go index a67f4bf370b..3db3066fa7e 100644 --- a/pkg/kubelet/dockertools/manager.go +++ b/pkg/kubelet/dockertools/manager.go @@ -338,8 +338,7 @@ func (dm *DockerManager) determineContainerIP(podNamespace, podName string, cont return result } -// TODO (random-liu) Remove parameter tPath when old containers are deprecated. -func (dm *DockerManager) inspectContainer(dockerID, containerName, tPath string, pod *api.Pod) *containerStatusResult { +func (dm *DockerManager) inspectContainer(dockerID, containerName string, pod *api.Pod) *containerStatusResult { result := containerStatusResult{api.ContainerStatus{}, "", nil} inspectResult, err := dm.client.InspectContainer(dockerID) @@ -410,11 +409,6 @@ func (dm *DockerManager) inspectContainer(dockerID, containerName, tPath string, ContainerID: DockerPrefix + dockerID, } terminationMessagePath := getTerminationMessagePathFromLabel(inspectResult.Config.Labels) - if terminationMessagePath == "" { - // Because old containers have no terminationMessagePath Label, we stil have to rely on the information from apiserver here. - // TODO (random-liu) Remove this later when old containers with no labels are deprecated. - terminationMessagePath = tPath - } if terminationMessagePath != "" { path, found := inspectResult.Volumes[terminationMessagePath] if found { @@ -484,17 +478,16 @@ func (dm *DockerManager) GetPodStatus(pod *api.Pod) (*api.PodStatus, error) { continue } dockerContainerName := dockerName.ContainerName - c, found := expectedContainers[dockerContainerName] + _, found := expectedContainers[dockerContainerName] if !found { continue } - terminationMessagePath := c.TerminationMessagePath if containerDone.Has(dockerContainerName) { continue } // Inspect the container. - result := dm.inspectContainer(value.ID, dockerContainerName, terminationMessagePath, pod) + result := dm.inspectContainer(value.ID, dockerContainerName, pod) if result.err != nil { return nil, result.err }