mirror of
https://github.com/rancher/os.git
synced 2025-04-27 11:10:56 +00:00
Make loading service retries configurable
This commit is contained in:
parent
88c5b5ef14
commit
29aaadd88c
@ -55,6 +55,7 @@ var schema = `{
|
||||
"restart_services": {"type": "array"},
|
||||
"hypervisor_service": {"type": "boolean"},
|
||||
"shutdown_timeout": {"type": "integer"},
|
||||
"http_load_retries": {"type": "integer"},
|
||||
"preload_wait": {"type": "boolean"}
|
||||
}
|
||||
},
|
||||
|
@ -152,6 +152,7 @@ type RancherConfig struct {
|
||||
RestartServices []string `yaml:"restart_services,omitempty"`
|
||||
HypervisorService bool `yaml:"hypervisor_service,omitempty"`
|
||||
ShutdownTimeout int `yaml:"shutdown_timeout,omitempty"`
|
||||
HTTPLoadRetries int `yaml:"http_load_retries,omitempty"`
|
||||
PreloadWait bool `yaml:"preload_wait,omitempty"`
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
rancher:
|
||||
shutdown_timeout: 60
|
||||
http_load_retries: 6
|
||||
environment:
|
||||
VERSION: {{.VERSION}}
|
||||
SUFFIX: {{.SUFFIX}}
|
||||
|
@ -108,8 +108,9 @@ func LoadFromNetwork(location string) ([]byte, error) {
|
||||
}
|
||||
SetProxyEnvironmentVariables()
|
||||
|
||||
cfg := config.LoadConfig()
|
||||
client := httpRetry.NewHTTPClient()
|
||||
client.MaxRetries = 3
|
||||
client.MaxRetries = cfg.Rancher.HTTPLoadRetries
|
||||
log.Debugf("start trying LoadFromNetwork(%s)", location)
|
||||
bytes, err := client.GetRetry(location)
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user