Redundant code process for container_mananger start

This commit is contained in:
Ke Zhang 2016-09-06 12:56:54 +08:00
parent aee6d10b57
commit eca14886ac

View File

@ -468,13 +468,14 @@ func (cm *containerManagerImpl) Start(node *api.Node) error {
return err
}
// Don't run a background thread if there are no ensureStateFuncs.
numEnsureStateFuncs := 0
hasEnsureStateFuncs := false
for _, cont := range cm.systemContainers {
if cont.ensureStateFunc != nil {
numEnsureStateFuncs++
hasEnsureStateFuncs = true
break
}
}
if numEnsureStateFuncs >= 0 {
if hasEnsureStateFuncs {
// Run ensure state functions every minute.
go wait.Until(func() {
for _, cont := range cm.systemContainers {