|
@@ -325,8 +325,8 @@ func (daemon *Daemon) restore() error {
|
|
logrus.Debug("Restarting containers...")
|
|
logrus.Debug("Restarting containers...")
|
|
|
|
|
|
for _, container := range registeredContainers {
|
|
for _, container := range registeredContainers {
|
|
- if container.hostConfig.RestartPolicy.Name == "always" ||
|
|
|
|
- (container.hostConfig.RestartPolicy.Name == "on-failure" && container.ExitCode != 0) {
|
|
|
|
|
|
+ if container.hostConfig.RestartPolicy.IsAlways() ||
|
|
|
|
+ (container.hostConfig.RestartPolicy.IsOnFailure() && container.ExitCode != 0) {
|
|
logrus.Debugf("Starting container %s", container.ID)
|
|
logrus.Debugf("Starting container %s", container.ID)
|
|
|
|
|
|
if err := container.Start(); err != nil {
|
|
if err := container.Start(); err != nil {
|