pkg/kubelet: return error when there is no cadvisor connection

pull/6/head
Xiang Li 2015-02-19 21:35:57 -08:00
parent ce1ced4322
commit c6d8bd8f5e
1 changed files with 1 additions and 1 deletions

View File

@ -69,7 +69,7 @@ func (kl *Kubelet) statsFromDockerContainer(cc cadvisorInterface, containerId st
func (kl *Kubelet) GetContainerInfo(podFullName string, uid types.UID, containerName string, req *cadvisor.ContainerInfoRequest) (*cadvisor.ContainerInfo, error) { func (kl *Kubelet) GetContainerInfo(podFullName string, uid types.UID, containerName string, req *cadvisor.ContainerInfoRequest) (*cadvisor.ContainerInfo, error) {
cc := kl.GetCadvisorClient() cc := kl.GetCadvisorClient()
if cc == nil { if cc == nil {
return nil, nil return nil, fmt.Errorf("no cadvisor connection")
} }
dockerContainers, err := dockertools.GetKubeletDockerContainers(kl.dockerClient, false) dockerContainers, err := dockertools.GetKubeletDockerContainers(kl.dockerClient, false)
if err != nil { if err != nil {