mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #1346 from aboch/lk
Lock in isAgent() and inMaster()
This commit is contained in:
commit
d6fefd1ad8
1 changed files with 4 additions and 0 deletions
|
@ -526,6 +526,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
|
||||
}
|
||||
|
@ -533,6 +535,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…
Add table
Reference in a new issue