server/server: check pods/ctrs directories before restore
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
parent
a2fe83fe56
commit
217d278623
1 changed files with 2 additions and 2 deletions
|
@ -142,7 +142,7 @@ func (s *Server) loadSandbox(id string) error {
|
||||||
|
|
||||||
func (s *Server) restore() {
|
func (s *Server) restore() {
|
||||||
sandboxDir, err := ioutil.ReadDir(s.sandboxDir)
|
sandboxDir, err := ioutil.ReadDir(s.sandboxDir)
|
||||||
if err != nil {
|
if err != nil && !os.IsNotExist(err) {
|
||||||
logrus.Warnf("could not read sandbox directory %s: %v", sandboxDir, err)
|
logrus.Warnf("could not read sandbox directory %s: %v", sandboxDir, err)
|
||||||
}
|
}
|
||||||
for _, v := range sandboxDir {
|
for _, v := range sandboxDir {
|
||||||
|
@ -154,7 +154,7 @@ func (s *Server) restore() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
containerDir, err := ioutil.ReadDir(s.runtime.ContainerDir())
|
containerDir, err := ioutil.ReadDir(s.runtime.ContainerDir())
|
||||||
if err != nil {
|
if err != nil && !os.IsNotExist(err) {
|
||||||
logrus.Warnf("could not read container directory %s: %v", s.runtime.ContainerDir(), err)
|
logrus.Warnf("could not read container directory %s: %v", s.runtime.ContainerDir(), err)
|
||||||
}
|
}
|
||||||
for _, v := range containerDir {
|
for _, v := range containerDir {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue