mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Lock in isAgent() and inMaster()
Signed-off-by: Alessandro Boch <aboch@docker.com>
This commit is contained in:
parent
46caa4c813
commit
3c36b06cb3
1 changed files with 4 additions and 0 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue