mirror of https://github.com/docker/docs.git
revert variable names
Signed-off-by: Alexandre Beslic <abronan@docker.com>
This commit is contained in:
parent
6b0b82cddc
commit
06f51e09b0
|
|
@ -125,7 +125,7 @@ func manage(c *cli.Context) {
|
||||||
log.Fatal("--heartbeat should be an unsigned integer and greater than 0")
|
log.Fatal("--heartbeat should be an unsigned integer and greater than 0")
|
||||||
}
|
}
|
||||||
options := &cluster.Options{
|
options := &cluster.Options{
|
||||||
TLS: tlsConfig,
|
TLSConfig: tlsConfig,
|
||||||
OvercommitRatio: c.Float64("overcommit"),
|
OvercommitRatio: c.Float64("overcommit"),
|
||||||
Discovery: dflag,
|
Discovery: dflag,
|
||||||
Heartbeat: hb,
|
Heartbeat: hb,
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import "crypto/tls"
|
||||||
|
|
||||||
// Options is exported
|
// Options is exported
|
||||||
type Options struct {
|
type Options struct {
|
||||||
TLS *tls.Config
|
TLSConfig *tls.Config
|
||||||
OvercommitRatio float64
|
OvercommitRatio float64
|
||||||
Discovery string
|
Discovery string
|
||||||
Heartbeat uint64
|
Heartbeat uint64
|
||||||
|
|
|
||||||
|
|
@ -138,7 +138,7 @@ func (c *Cluster) newEntries(entries []*discovery.Entry) {
|
||||||
go func(m *discovery.Entry) {
|
go func(m *discovery.Entry) {
|
||||||
if !c.hasEngine(m.String()) {
|
if !c.hasEngine(m.String()) {
|
||||||
engine := cluster.NewEngine(m.String(), c.options.OvercommitRatio)
|
engine := cluster.NewEngine(m.String(), c.options.OvercommitRatio)
|
||||||
if err := engine.Connect(c.options.TLS); err != nil {
|
if err := engine.Connect(c.options.TLSConfig); err != nil {
|
||||||
log.Error(err)
|
log.Error(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -54,16 +54,16 @@ func (s *Discovery) Fetch() ([]*discovery.Entry, error) {
|
||||||
|
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
|
|
||||||
var entries []string
|
var addrs []string
|
||||||
if resp.StatusCode == http.StatusOK {
|
if resp.StatusCode == http.StatusOK {
|
||||||
if err := json.NewDecoder(resp.Body).Decode(&entries); err != nil {
|
if err := json.NewDecoder(resp.Body).Decode(&addrs); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return nil, fmt.Errorf("Failed to fetch entries, Discovery service returned %d HTTP status code", resp.StatusCode)
|
return nil, fmt.Errorf("Failed to fetch entries, Discovery service returned %d HTTP status code", resp.StatusCode)
|
||||||
}
|
}
|
||||||
|
|
||||||
return discovery.CreateEntries(entries)
|
return discovery.CreateEntries(addrs)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Watch is exported
|
// Watch is exported
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue