From cc3f264a35f4f1e8826d7de0d8917968cd34ed9b Mon Sep 17 00:00:00 2001 From: Alex Dadgar Date: Mon, 16 Apr 2018 15:48:34 -0700 Subject: [PATCH] Cleanup --- client/client.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/client/client.go b/client/client.go index 82e685f12..35adbc534 100644 --- a/client/client.go +++ b/client/client.go @@ -277,12 +277,6 @@ func NewClient(cfg *config.Config, consulCatalog consul.CatalogAPI, consulServic // Setup the reserved resources c.reservePorts() - // Store the config copy before restoring state but after it has been - // initialized. - c.configLock.Lock() - c.configCopy = c.config.Copy() - c.configLock.Unlock() - // Set the preconfigured list of static servers c.configLock.RLock() if len(c.configCopy.Servers) > 0 { @@ -969,6 +963,9 @@ func (c *Client) reservePorts() { for _, net := range reservedIndex { node.Reserved.Networks = append(node.Reserved.Networks, net) } + + // Make the changes available to the config copy. + c.configCopy = c.config.Copy() } // updateNodeFromFingerprint updates the node with the result of