Make errors during refresh nonfatal

During refresh, we cannot hard-fail, as that would mean leaving a
partially-configured state behind, leaving libpod unable to start
without manual intervention.

Instead, log errors refreshing individual containers and pods and
continue. Individual containers and pods may be unusable and need
to be removed manually, but libpod itself will continue to
function.

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

Closes: #1252
Approved by: rhatdan
This commit is contained in:
Matthew Heon 2018-08-10 10:35:25 -04:00 committed by Atomic Bot
parent 71c28c7cda
commit 7366697175
1 changed files with 2 additions and 4 deletions

View File

@ -628,16 +628,14 @@ func (r *Runtime) refresh(alivePath string) error {
for _, ctr := range ctrs {
ctr.lock.Lock()
if err := ctr.refresh(); err != nil {
ctr.lock.Unlock()
return err
logrus.Errorf("Error refreshing container %s: %v", ctr.ID(), err)
}
ctr.lock.Unlock()
}
for _, pod := range pods {
pod.lock.Lock()
if err := pod.refresh(); err != nil {
pod.lock.Unlock()
return err
logrus.Errorf("Error refreshing pod %s: %v", pod.ID(), err)
}
pod.lock.Unlock()
}