From 1b8d115b63a24e9b74cd3675ae373c238739d002 Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Tue, 9 May 2017 15:41:20 +0000 Subject: [PATCH] Refactor: make weave API a part of the proxy struct --- proxy/proxy.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/proxy/proxy.go b/proxy/proxy.go index 846a60d4..1777194d 100644 --- a/proxy/proxy.go +++ b/proxy/proxy.go @@ -77,6 +77,7 @@ type Proxy struct { sync.Mutex Config client *docker.Client + weave *weaveapi.Client dockerBridgeIP string hostnameMatchRegexp *regexp.Regexp weaveWaitVolume string @@ -129,6 +130,7 @@ func NewProxy(c Config) (*Proxy, error) { waiters: make(map[*http.Request]*wait), attachJobs: make(map[string]*attachJob), quit: make(chan struct{}), + weave: weaveapi.NewClient(os.Getenv("WEAVE_HTTP_ADDR"), Log), } if err := p.TLSConfig.LoadCerts(); err != nil { @@ -594,8 +596,7 @@ func (proxy *Proxy) getDNSDomain() string { if proxy.WithoutDNS { return "" } - weave := weaveapi.NewClient(os.Getenv("WEAVE_HTTP_ADDR"), Log) - domain, _ := weave.DNSDomain() + domain, _ := proxy.weave.DNSDomain() return domain }