Merge pull request #1346 from aboch/lk

Lock in isAgent() and inMaster()
This commit is contained in:
Madhu Venugopal 2016-07-22 17:50:39 -07:00 committed by GitHub
commit d6fefd1ad8
1 changed files with 4 additions and 0 deletions

View File

@ -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
}