server: do not add ctrs with bad state when restoring
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
parent
c61a83a930
commit
437459bd64
1 changed files with 2 additions and 0 deletions
|
@ -107,6 +107,7 @@ func (s *Server) loadContainer(id string) error {
|
||||||
s.addContainer(ctr)
|
s.addContainer(ctr)
|
||||||
if err = s.runtime.UpdateStatus(ctr); err != nil {
|
if err = s.runtime.UpdateStatus(ctr); err != nil {
|
||||||
logrus.Warnf("error updating status for container %s: %v", ctr.ID(), err)
|
logrus.Warnf("error updating status for container %s: %v", ctr.ID(), err)
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
if err = s.ctrIDIndex.Add(id); err != nil {
|
if err = s.ctrIDIndex.Add(id); err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -213,6 +214,7 @@ func (s *Server) loadSandbox(id string) error {
|
||||||
sb.infraContainer = scontainer
|
sb.infraContainer = scontainer
|
||||||
if err = s.runtime.UpdateStatus(scontainer); err != nil {
|
if err = s.runtime.UpdateStatus(scontainer); err != nil {
|
||||||
logrus.Warnf("error updating status for pod sandbox infra container %s: %v", scontainer.ID(), err)
|
logrus.Warnf("error updating status for pod sandbox infra container %s: %v", scontainer.ID(), err)
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
if err = s.ctrIDIndex.Add(scontainer.ID()); err != nil {
|
if err = s.ctrIDIndex.Add(scontainer.ID()); err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in a new issue