From dad365fb2bdf16a5799591575bfc759108d869e3 Mon Sep 17 00:00:00 2001 From: Dawn Chen Date: Thu, 26 Feb 2015 18:02:04 -0800 Subject: [PATCH] Hide POD container from end users --- cmd/integration/integration.go | 3 ++- pkg/kubelet/dockertools/docker.go | 3 ++- pkg/kubelet/kubelet.go | 8 +++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cmd/integration/integration.go b/cmd/integration/integration.go index 08b6eaecb0258..dbdae4d0bddcf 100644 --- a/cmd/integration/integration.go +++ b/cmd/integration/integration.go @@ -91,7 +91,6 @@ func (fakeKubeletClient) GetPodStatus(host, podNamespace, podID string) (api.Pod m := make(api.PodInfo) for k, v := range r.Status.Info { v.Ready = true - v.PodIP = "1.2.3.4" m[k] = v } r.Status.Info = m @@ -257,8 +256,10 @@ func endpointsSet(c *client.Client, serviceNamespace, serviceID string, endpoint return func() (bool, error) { endpoints, err := c.Endpoints(serviceNamespace).Get(serviceID) if err != nil { + glog.Infof("Error on creating endpoints: %v", err) return false, nil } + glog.Infof("endpoints: %v", endpoints.Endpoints) return len(endpoints.Endpoints) == endpointCount, nil } } diff --git a/pkg/kubelet/dockertools/docker.go b/pkg/kubelet/dockertools/docker.go index e2e3e00fc9146..9630bc234a9b1 100644 --- a/pkg/kubelet/dockertools/docker.go +++ b/pkg/kubelet/dockertools/docker.go @@ -590,7 +590,8 @@ func inspectContainer(client DockerInterface, dockerID, containerName, tPath str return &containerStatus, nil } -// GetDockerPodInfo returns docker info for all containers in the pod/manifest. +// GetDockerPodInfo returns docker info for all containers in the pod/manifest and +// infrastructure container func GetDockerPodInfo(client DockerInterface, manifest api.PodSpec, podFullName string, uid types.UID) (api.PodInfo, error) { info := api.PodInfo{} expectedContainers := make(map[string]api.Container) diff --git a/pkg/kubelet/kubelet.go b/pkg/kubelet/kubelet.go index b98a65aac4f9a..906fce6090b9f 100644 --- a/pkg/kubelet/kubelet.go +++ b/pkg/kubelet/kubelet.go @@ -1692,21 +1692,19 @@ func (kl *Kubelet) GetPodStatus(podFullName string, uid types.UID) (api.PodStatu // Assume info is ready to process podStatus.Phase = getPhase(spec, info) + podStatus.Info = api.PodInfo{} for _, c := range spec.Containers { containerStatus := info[c.Name] containerStatus.Ready = kl.readiness.IsReady(containerStatus) - info[c.Name] = containerStatus + podStatus.Info[c.Name] = containerStatus } - podStatus.Conditions = append(podStatus.Conditions, getPodReadyCondition(spec, info)...) + podStatus.Conditions = append(podStatus.Conditions, getPodReadyCondition(spec, podStatus.Info)...) netContainerInfo, found := info[dockertools.PodInfraContainerName] if found { podStatus.PodIP = netContainerInfo.PodIP } - // TODO(dchen1107): Change Info to list from map - podStatus.Info = info - return podStatus, nil }