Skip to content
This repository was archived by the owner on Mar 22, 2018. It is now read-only.

Commit cf2a1cb

Browse files
committed
Merge branch 'master' into node_ipam_branch
2 parents 2ec6023 + 47f71bb commit cf2a1cb

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

pkg/cloudprovider/providers/openstack/openstack.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ import (
5252
const (
5353
ProviderName = "openstack"
5454
AvailabilityZone = "availability_zone"
55+
defaultTimeOut = 60 * time.Second
5556
)
5657

5758
var ErrNotFound = errors.New("Failed to find object")
@@ -101,7 +102,8 @@ type RouterOpts struct {
101102
}
102103

103104
type MetadataOpts struct {
104-
SearchOrder string `gcfg:"search-order"`
105+
SearchOrder string `gcfg:"search-order"`
106+
RequestTimeout MyDuration `gcfg:"request-timeout"`
105107
}
106108

107109
// OpenStack is an implementation of cloud provider Interface for OpenStack.
@@ -290,6 +292,12 @@ func newOpenStack(cfg Config) (*OpenStack, error) {
290292
return nil, err
291293
}
292294

295+
emptyDuration := MyDuration{}
296+
if cfg.Metadata.RequestTimeout == emptyDuration {
297+
cfg.Metadata.RequestTimeout.Duration = time.Duration(defaultTimeOut)
298+
}
299+
provider.HTTPClient.Timeout = cfg.Metadata.RequestTimeout.Duration
300+
293301
os := OpenStack{
294302
provider: provider,
295303
region: cfg.Global.Region,

0 commit comments

Comments
 (0)