The same err should not judge whether it is empty twice, and the err of "GetKubeletContainer" function should not affect the value of "RuntimeCgroups"

This commit is contained in:
HirazawaUi 2022-04-07 11:08:25 +08:00
parent 21184400a4
commit fc0d38f02f

View File

@ -620,9 +620,7 @@ func run(ctx context.Context, s *options.KubeletServer, kubeDeps *kubelet.Depend
cgroupRoots = append(cgroupRoots, kubeletCgroup)
}
if err != nil {
klog.InfoS("Failed to get the container runtime's cgroup. Runtime system container metrics may be missing.", "err", err)
} else if s.RuntimeCgroups != "" {
if s.RuntimeCgroups != "" {
// RuntimeCgroups is optional, so ignore if it isn't specified
cgroupRoots = append(cgroupRoots, s.RuntimeCgroups)
}