mirror of https://github.com/k3s-io/k3s
pkg/kubelet: return error when there is no cadvisor connection
parent
ce1ced4322
commit
c6d8bd8f5e
|
@ -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 {
|
||||||
|
|
Loading…
Reference in New Issue