mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-18 08:09:58 +00:00
Merge pull request #9809 from bprashanth/stats_cache
Use runtime cache to serve container /stats requests
This commit is contained in:
commit
cc5756b2fc
@ -2223,10 +2223,12 @@ func (kl *Kubelet) GetContainerInfo(podFullName string, podUID types.UID, contai
|
||||
|
||||
podUID = kl.podManager.TranslatePodUID(podUID)
|
||||
|
||||
container, err := kl.findContainer(podFullName, podUID, containerName)
|
||||
pods, err := kl.runtimeCache.GetPods()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
pod := kubecontainer.Pods(pods).FindPod(podFullName, podUID)
|
||||
container := pod.FindContainerByName(containerName)
|
||||
if container == nil {
|
||||
return nil, ErrContainerNotFound
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user