Make CGroups cleanup optional on whether they exist

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #981
Approved by: baude
This commit is contained in:
Matthew Heon
2018-06-21 11:09:17 -04:00
committed by Atomic Bot
parent d2f981fd0b
commit c3602075ec
5 changed files with 36 additions and 7 deletions

View File

@ -570,14 +570,20 @@ func (r *Runtime) refresh(alivePath string) error {
return errors.Wrapf(err, "error retrieving all pods from state")
}
for _, ctr := range ctrs {
ctr.lock.Lock()
if err := ctr.refresh(); err != nil {
ctr.lock.Unlock()
return err
}
ctr.lock.Unlock()
}
for _, pod := range pods {
pod.lock.Lock()
if err := pod.refresh(); err != nil {
pod.lock.Unlock()
return err
}
pod.lock.Unlock()
}
// Create a file indicating the runtime is alive and ready