1
0
mirror of https://github.com/rancher/os.git synced 2025-07-13 06:34:04 +00:00

Ignore ErrMountNameConflict when service up

This commit is contained in:
niusmallnan 2019-02-21 17:00:45 +08:00 committed by niusmallnan
parent 7f4f270129
commit 3a88b2e699

View File

@ -2,10 +2,12 @@ package docker
import (
"fmt"
"strings"
"github.com/rancher/os/config"
"github.com/rancher/os/pkg/log"
"github.com/docker/docker/layer"
dockerclient "github.com/docker/engine-api/client"
"github.com/docker/engine-api/types"
composeConfig "github.com/docker/libcompose/config"
@ -148,9 +150,15 @@ func (s *Service) Up(ctx context.Context, options options.Up) error {
}
for _, c := range cs {
if _, err := c.(*docker.Container).Recreate(ctx, s.Config().Image); err != nil {
// sometimes we can get ErrMountNameConflict when booting on RPi
// ignore this error so that ros can boot success, otherwise it will hang forever
if strings.Contains(err.Error(), layer.ErrMountNameConflict.Error()) {
log.Warn(err)
} else {
return err
}
}
}
if err = s.rename(ctx); err != nil {
return err
}