Browse Source

daemon/cluster: add a missing Unlock

Signed-off-by: Ziheng Liu <lzhfromustc@gmail.com>
Ziheng Liu 5 years ago
parent
commit
83c0bedba9
1 changed files with 1 additions and 0 deletions
  1. 1 0
      daemon/cluster/swarm.go

+ 1 - 0
daemon/cluster/swarm.go

@@ -33,6 +33,7 @@ func (c *Cluster) Init(req types.InitRequest) (string, error) {
 			// API handlers to finish before shutting down the node.
 			c.mu.Lock()
 			if !c.nr.nodeState.IsManager() {
+				c.mu.Unlock()
 				return "", errSwarmNotManager
 			}
 			c.mu.Unlock()