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

Merge pull request #40594 from sfzhu93/Mis_Unlock

daemon/cluster: add a missing Unlock
This commit is contained in:
Brian Goff 2020-02-28 09:47:53 -08:00 committed by GitHub
commit 40b2b4b083
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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