Skip to content

Commit

Permalink
kube-ovn-cni: fix pinger result when timeout is reached (#3457)
Browse files Browse the repository at this point in the history
Signed-off-by: zhangzujian <[email protected]>
  • Loading branch information
zhangzujian authored Nov 24, 2023
1 parent e334b60 commit 07798be
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/daemon/ovs.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ func pingGateway(gw, src string, verbose bool, maxRetry int) (count int, err err
return 0, err
}

if pinger.PacketsRecv == 0 {
klog.Warningf("%s network not ready after %d ping, gw %s", src, pinger.PacketsSent, gw)
return pinger.PacketsSent, fmt.Errorf("no packets received from gateway %s", gw)
}

cniConnectivityResult.WithLabelValues(nodeName).Add(float64(pinger.PacketsSent))
if verbose {
klog.Infof("%s network ready after %d ping, gw %s", src, pinger.PacketsSent, gw)
Expand Down

0 comments on commit 07798be

Please sign in to comment.