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 committed Nov 24, 2023
1 parent 1dd86ea commit 58baa38
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 @@ -32,6 +32,11 @@ func pingGateway(gw, src string, verbose bool, maxRetry int) error {
}
pinger.Run()

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)

Check failure on line 37 in pkg/daemon/ovs.go

View workflow job for this annotation

GitHub Actions / Build arm64

too many return values

Check failure on line 37 in pkg/daemon/ovs.go

View workflow job for this annotation

GitHub Actions / Build arm64

too many return values

Check failure on line 37 in pkg/daemon/ovs.go

View workflow job for this annotation

GitHub Actions / Build kube-ovn

too many return values

Check failure on line 37 in pkg/daemon/ovs.go

View workflow job for this annotation

GitHub Actions / Build Kube-OVN

too many return values

Check failure on line 37 in pkg/daemon/ovs.go

View workflow job for this annotation

GitHub Actions / Build Kube-OVN

too many return values
}

cniConnectivityResult.WithLabelValues(nodeName).Add(float64(pinger.PacketsSent))
if !success {
return fmt.Errorf("%s network not ready after %d ping %s", src, maxRetry, gw)
Expand Down

0 comments on commit 58baa38

Please sign in to comment.