From 9f0cd938597a0ea7b4f1c60e11c3a72bc7c5dfbc Mon Sep 17 00:00:00 2001 From: Matthias Radestock Date: Mon, 22 Jun 2015 12:50:50 +0100 Subject: [PATCH] refactor(ish): get the more fundamental setup out of the way first --- proxy/proxy.go | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/proxy/proxy.go b/proxy/proxy.go index e04b8824..7191a4a4 100644 --- a/proxy/proxy.go +++ b/proxy/proxy.go @@ -41,14 +41,6 @@ type Proxy struct { func NewProxy(c Config) (*Proxy, error) { p := &Proxy{Config: c} - if !p.WithoutDNS { - dockerBridgeIP, err := callWeave("docker-bridge-ip") - if err != nil { - return nil, err - } - p.dockerBridgeIP = string(dockerBridgeIP) - } - if err := p.TLSConfig.loadCerts(); err != nil { Error.Fatalf("Could not configure tls for proxy: %s", err) } @@ -58,6 +50,15 @@ func NewProxy(c Config) (*Proxy, error) { return nil, err } p.client = client + + if !p.WithoutDNS { + dockerBridgeIP, err := callWeave("docker-bridge-ip") + if err != nil { + return nil, err + } + p.dockerBridgeIP = string(dockerBridgeIP) + } + return p, nil }