Merge pull request #40604 from thaJeztah/19.03_backport_mis_unlock

[19.03 backport] daemon/cluster: add a missing Unlock
This commit is contained in:
Akihiro Suda 2020-02-29 10:37:35 +09:00 committed by GitHub
commit 71373c6105
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -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()