1
0
mirror of https://github.com/rancher/os.git synced 2025-09-12 21:23:13 +00:00

Wait for default gateway before loading resource from network

This commit is contained in:
niusmallnan
2019-06-17 17:24:21 +08:00
committed by niusmallnan
parent 65c97ea462
commit 1ff4f6ebaa
2 changed files with 114 additions and 2 deletions

View File

@@ -101,10 +101,13 @@ func LoadFromNetworkWithCache(location string) ([]byte, error) {
}
func LoadFromNetwork(location string) ([]byte, error) {
SetProxyEnvironmentVariables()
var err error
if err = AllDefaultGWOK(DefaultRoutesCheckTimeout); err != nil {
return nil, err
}
SetProxyEnvironmentVariables()
var resp *http.Response
log.Debugf("LoadFromNetwork(%s)", location)
resp, err = http.Get(location)