diff --git a/pkg/pinger/config.go b/pkg/pinger/config.go index 61de6ba273e..44046f4dde9 100644 --- a/pkg/pinger/config.go +++ b/pkg/pinger/config.go @@ -169,8 +169,8 @@ func ParseFlags() (*Configuration, error) { break } - if pod.Status.ContainerStatuses[0].Ready { - util.LogFatalAndExit(nil, "failed to get IPs of Pod %s/%s", config.DaemonSetNamespace, podName) + if len(pod.Status.ContainerStatuses) != 0 && pod.Status.ContainerStatuses[0].Ready { + util.LogFatalAndExit(nil, "failed to get IPs of Pod %s/%s: podIPs is empty while the container is ready", config.DaemonSetNamespace, podName) } klog.Infof("cannot get Pod IPs now, waiting Pod to be ready")