1
0
Fork 0

Allow specification of dialertimeout

Address documentation comments
This commit is contained in:
Bruce Lee 2016-10-05 11:42:58 -04:00
parent 91e3bdff48
commit e068ee09ca
4 changed files with 30 additions and 7 deletions

View file

@ -2,6 +2,7 @@ package provider
import (
"errors"
"net"
"net/url"
"sort"
"strconv"
@ -26,13 +27,14 @@ var _ Provider = (*Marathon)(nil)
// Marathon holds configuration of the Marathon provider.
type Marathon struct {
BaseProvider
Endpoint string `description:"Marathon server endpoint. You can also specify multiple endpoint for Marathon"`
Domain string `description:"Default domain used"`
ExposedByDefault bool `description:"Expose Marathon apps by default"`
GroupsAsSubDomains bool `description:"Convert Marathon groups to subdomains"`
DCOSToken string `description:"DCOSToken for DCOS environment, This will override the Authorization header"`
MarathonLBCompatibility bool `description:"Add compatibility with marathon-lb labels"`
TLS *ClientTLS `description:"Enable Docker TLS support"`
Endpoint string `description:"Marathon server endpoint. You can also specify multiple endpoint for Marathon"`
Domain string `description:"Default domain used"`
ExposedByDefault bool `description:"Expose Marathon apps by default"`
GroupsAsSubDomains bool `description:"Convert Marathon groups to subdomains"`
DCOSToken string `description:"DCOSToken for DCOS environment, This will override the Authorization header"`
MarathonLBCompatibility bool `description:"Add compatibility with marathon-lb labels"`
TLS *ClientTLS `description:"Enable Docker TLS support"`
DialerTimeout time.Duration `description:"Set a non-default connection timeout for Marathon"`
Basic *MarathonBasic
marathonClient marathon.Marathon
}
@ -70,6 +72,9 @@ func (provider *Marathon) Provide(configurationChan chan<- types.ConfigMessage,
config.HTTPClient = &http.Client{
Transport: &http.Transport{
TLSClientConfig: TLSConfig,
DialContext: (&net.Dialer{
Timeout: time.Second * provider.DialerTimeout,
}).DialContext,
},
}
client, err := marathon.NewClient(config)