From 3c36b06cb3c3034eb9ef9f279f88be920a4e3992 Mon Sep 17 00:00:00 2001 From: Alessandro Boch Date: Fri, 22 Jul 2016 14:21:28 -0700 Subject: [PATCH] Lock in isAgent() and inMaster() Signed-off-by: Alessandro Boch --- libnetwork/controller.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libnetwork/controller.go b/libnetwork/controller.go index 9bb1c7c5bb..a0a4ec91d4 100644 --- a/libnetwork/controller.go +++ b/libnetwork/controller.go @@ -522,6 +522,8 @@ func (c *controller) Config() config.Config { } func (c *controller) isManager() bool { + c.Lock() + defer c.Unlock() if c.cfg == nil || c.cfg.Daemon.ClusterProvider == nil { return false } @@ -529,6 +531,8 @@ func (c *controller) isManager() bool { } func (c *controller) isAgent() bool { + c.Lock() + defer c.Unlock() if c.cfg == nil || c.cfg.Daemon.ClusterProvider == nil { return false }