Skip to content

Commit

Permalink
Fix wait pod network ready take long time
Browse files Browse the repository at this point in the history
(cherry picked from commit fcf3be1)
  • Loading branch information
halfcrazy authored and oilbeater committed Mar 9, 2021
1 parent bbb7edc commit cf72588
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pkg/daemon/ovs.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,10 @@ func waitNetworkReady(gateway string) error {
return fmt.Errorf("failed to init pinger, %v", err)
}
pinger.SetPrivileged(true)
pinger.Count = 600
pinger.Timeout = 600 * time.Second
// CNITimeoutSec = 220, cannot exceed
count := 200
pinger.Count = count
pinger.Timeout = time.Duration(count) * time.Second
pinger.Interval = 1 * time.Second

success := false
Expand All @@ -226,7 +228,7 @@ func waitNetworkReady(gateway string) error {

cniConnectivityResult.WithLabelValues(nodeName).Add(float64(pinger.PacketsSent))
if !success {
return fmt.Errorf("network not ready after 600 ping")
return fmt.Errorf("network not ready after %d ping", count)
}
klog.Infof("network ready after %d ping, gw %v", pinger.PacketsSent, gw)
}
Expand Down

0 comments on commit cf72588

Please sign in to comment.