Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: change the order of generating MountPoints #1541

Merged
merged 1 commit into from
Jun 19, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions daemon/mgr/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -1880,24 +1880,28 @@ func (mgr *ContainerManager) generateMountPoints(ctx context.Context, c *Contain
}
}()

err = mgr.getMountPointFromVolumes(ctx, c, volumeSet)
// 1. read MountPoints from other containers
err = mgr.getMountPointFromContainers(ctx, c, volumeSet)
if err != nil {
return errors.Wrap(err, "failed to get mount point from volumes")
return errors.Wrap(err, "failed to get mount point from containers")
}

err = mgr.getMountPointFromImage(ctx, c, volumeSet)
// 2. read MountPoints from binds
err = mgr.getMountPointFromBinds(ctx, c, volumeSet)
if err != nil {
return errors.Wrap(err, "failed to get mount point from image")
return errors.Wrap(err, "failed to get mount point from binds")
}

err = mgr.getMountPointFromBinds(ctx, c, volumeSet)
// 3. read MountPoints from image
err = mgr.getMountPointFromImage(ctx, c, volumeSet)
if err != nil {
return errors.Wrap(err, "failed to get mount point from binds")
return errors.Wrap(err, "failed to get mount point from image")
}

err = mgr.getMountPointFromContainers(ctx, c, volumeSet)
// 4. read MountPoints from Config.Volumes
err = mgr.getMountPointFromVolumes(ctx, c, volumeSet)
if err != nil {
return errors.Wrap(err, "failed to get mount point from containers")
return errors.Wrap(err, "failed to get mount point from volumes")
}

return nil
Expand Down