1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

daemon/cluster: add a missing Unlock

Signed-off-by: Ziheng Liu <lzhfromustc@gmail.com>
(cherry picked from commit 83c0bedba9)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Ziheng Liu 2020-02-25 13:55:11 -05:00 committed by Sebastiaan van Stijn
parent bb19f8cc90
commit 1e3971d556
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C

View file

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