mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #14349 from hqhq/hq_error_for_todisk
Show error message when todisk failed
This commit is contained in:
commit
5b2d14fbbf
4 changed files with 8 additions and 4 deletions
|
@ -6,6 +6,7 @@ import (
|
|||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/Sirupsen/logrus"
|
||||
"github.com/docker/docker/graph"
|
||||
"github.com/docker/docker/image"
|
||||
"github.com/docker/docker/pkg/parsers"
|
||||
|
@ -136,6 +137,7 @@ func (daemon *Daemon) Create(config *runconfig.Config, hostConfig *runconfig.Hos
|
|||
container.addMountPointWithVolume(destination, v, true)
|
||||
}
|
||||
if err := container.ToDisk(); err != nil {
|
||||
logrus.Errorf("Error saving new container to disk: %v", err)
|
||||
return nil, nil, err
|
||||
}
|
||||
container.LogEvent("create")
|
||||
|
|
|
@ -219,7 +219,7 @@ func (daemon *Daemon) register(container *Container, updateSuffixarray bool) err
|
|||
logrus.Debugf("unmount error %s", err)
|
||||
}
|
||||
if err := container.ToDisk(); err != nil {
|
||||
logrus.Debugf("saving stopped state to disk %s", err)
|
||||
logrus.Errorf("Error saving stopped state to disk: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -235,7 +235,7 @@ func (daemon *Daemon) ensureName(container *Container) error {
|
|||
container.Name = name
|
||||
|
||||
if err := container.ToDisk(); err != nil {
|
||||
logrus.Debugf("Error saving container name %s", err)
|
||||
logrus.Errorf("Error saving container name to disk: %v", err)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
|
|
|
@ -92,7 +92,9 @@ func (daemon *Daemon) rm(container *Container, forceRemove bool) (err error) {
|
|||
// Save container state to disk. So that if error happens before
|
||||
// container meta file got removed from disk, then a restart of
|
||||
// docker should not make a dead container alive.
|
||||
container.ToDisk()
|
||||
if err := container.ToDisk(); err != nil {
|
||||
logrus.Errorf("Error saving dying container to disk: %v", err)
|
||||
}
|
||||
|
||||
// If force removal is required, delete container from various
|
||||
// indexes even if removal failed.
|
||||
|
|
|
@ -263,7 +263,7 @@ func (m *containerMonitor) callback(processConfig *execdriver.ProcessConfig, pid
|
|||
}
|
||||
|
||||
if err := m.container.ToDisk(); err != nil {
|
||||
logrus.Debugf("%s", err)
|
||||
logrus.Errorf("Error saving container to disk: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue