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 <zhangzujian.7@gmail.com>
  • Loading branch information
zhangzujian committed Nov 24, 2023
1 parent df2a9c3 commit 0fb4f19
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/daemon/ovs.go
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 0fb4f19

Please sign in to comment.