Openstack: Reduce timeouts (#7507)

Set saner values for openstack timeouts

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
This commit is contained in:
Julien Pivotto 2020-07-02 22:50:32 +02:00 committed by GitHub
parent 9c9b872087
commit e1f9816a33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -53,7 +53,7 @@ type SDConfig struct {
ApplicationCredentialSecret config_util.Secret `yaml:"application_credential_secret"`
Role Role `yaml:"role"`
Region string `yaml:"region"`
RefreshInterval model.Duration `yaml:"refresh_interval,omitempty"`
RefreshInterval model.Duration `yaml:"refresh_interval"`
Port int `yaml:"port"`
AllTenants bool `yaml:"all_tenants,omitempty"`
TLSConfig config_util.TLSConfig `yaml:"tls_config,omitempty"`
@ -163,14 +163,14 @@ func newRefresher(conf *SDConfig, l log.Logger) (refresher, error) {
}
client.HTTPClient = http.Client{
Transport: &http.Transport{
IdleConnTimeout: 5 * time.Duration(conf.RefreshInterval),
IdleConnTimeout: 2 * time.Duration(conf.RefreshInterval),
TLSClientConfig: tls,
DialContext: conntrack.NewDialContextFunc(
conntrack.DialWithTracing(),
conntrack.DialWithName("openstack_sd"),
),
},
Timeout: 5 * time.Duration(conf.RefreshInterval),
Timeout: time.Duration(conf.RefreshInterval),
}
availability := gophercloud.Availability(conf.Availability)
switch conf.Role {