mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Allow containers to continue even if mount failed after live restore
This fix is a follow up to #29365. In #29365 a bug was fixed for
`docker exec -u user` after live restore by remounting.
However, #29365 will prevent containers from restored if mount failed.
In this fix, containers will be restored even if mount in that step failed.
Some functionalities might be missing (like `docker exec -u user`) but
at least it is possible to do certain operations like stop/restart/delete.
This fix is related to #29365.
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit 3003ae1d8b
)
This commit is contained in:
parent
43cc971d76
commit
25b967e149
1 changed files with 7 additions and 2 deletions
|
@ -148,8 +148,13 @@ func (daemon *Daemon) restore() error {
|
|||
}
|
||||
container.RWLayer = rwlayer
|
||||
if err := daemon.Mount(container); err != nil {
|
||||
logrus.Errorf("Failed to mount container %v: %v", id, err)
|
||||
continue
|
||||
// The mount is unlikely to fail. However, in case mount fails
|
||||
// the container should be allowed to restore here. Some functionalities
|
||||
// (like docker exec -u user) might be missing but container is able to be
|
||||
// stopped/restarted/removed.
|
||||
// See #29365 for related information.
|
||||
// The error is only logged here.
|
||||
logrus.Warnf("Failed to mount container %v: %v", id, err)
|
||||
}
|
||||
logrus.Debugf("Loaded container %v", container.ID)
|
||||
|
||||
|
|
Loading…
Reference in a new issue