From 5f77f2b5a91c6bde6135e26a363d6355b3376ad2 Mon Sep 17 00:00:00 2001 From: jiangyaoguo Date: Wed, 25 Nov 2015 17:26:38 +0800 Subject: [PATCH] make PodContainerSpecChange private --- pkg/kubelet/dockertools/manager.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/pkg/kubelet/dockertools/manager.go b/pkg/kubelet/dockertools/manager.go index 8e789e82645..7d8622c7219 100644 --- a/pkg/kubelet/dockertools/manager.go +++ b/pkg/kubelet/dockertools/manager.go @@ -1608,7 +1608,6 @@ func (dm *DockerManager) createPodInfraContainer(pod *api.Pod) (kubetypes.Docker return kubetypes.DockerID(id.ID), nil } -// TODO(vmarmol): This will soon be made non-public when its only use is internal. // Structure keeping information on changes that need to happen for a pod. The semantics is as follows: // - startInfraContainer is true if new Infra Containers have to be started and old one (if running) killed. // Additionally if it is true then containersToKeep have to be empty @@ -1619,7 +1618,7 @@ func (dm *DockerManager) createPodInfraContainer(pod *api.Pod) (kubetypes.Docker // It shouldn't be the case where containersToStart is empty and containersToKeep contains only infraContainerId. In such case // Infra Container should be killed, hence it's removed from this map. // - all running containers which are NOT contained in containersToKeep should be killed. -type PodContainerChangesSpec struct { +type podContainerChangesSpec struct { StartInfraContainer bool InfraChanged bool InfraContainerId kubetypes.DockerID @@ -1627,7 +1626,7 @@ type PodContainerChangesSpec struct { ContainersToKeep map[kubetypes.DockerID]int } -func (dm *DockerManager) computePodContainerChanges(pod *api.Pod, podStatus *kubecontainer.PodStatus) (PodContainerChangesSpec, error) { +func (dm *DockerManager) computePodContainerChanges(pod *api.Pod, podStatus *kubecontainer.PodStatus) (podContainerChangesSpec, error) { start := time.Now() defer func() { metrics.ContainerManagerLatency.WithLabelValues("computePodContainerChanges").Observe(metrics.SinceInMicroseconds(start)) @@ -1648,7 +1647,7 @@ func (dm *DockerManager) computePodContainerChanges(pod *api.Pod, podStatus *kub glog.V(4).Infof("Found pod infra container for %q", podFullName) changed, err = dm.podInfraContainerChanged(pod, podInfraContainerStatus) if err != nil { - return PodContainerChangesSpec{}, err + return podContainerChangesSpec{}, err } } @@ -1729,7 +1728,7 @@ func (dm *DockerManager) computePodContainerChanges(pod *api.Pod, podStatus *kub containersToKeep = make(map[kubetypes.DockerID]int) } - return PodContainerChangesSpec{ + return podContainerChangesSpec{ StartInfraContainer: createPodInfraContainer, InfraChanged: changed, InfraContainerId: podInfraContainerID,