fix: skip pods with empty ip

This commit is contained in:
Jian Zeng 2021-05-27 16:06:34 +08:00
parent 32c14da902
commit 781c65a40c

View File

@ -50,6 +50,9 @@ func SetupMetricsProxy(c clientset.Interface) error {
}
var foundComponents []componentInfo
for _, pod := range podList.Items {
if len(pod.Status.PodIP) == 0 {
continue
}
switch {
case strings.HasPrefix(pod.Name, "kube-scheduler-"):
foundComponents = append(foundComponents, componentInfo{