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: failed to create 'volumefrom' container #1161

Merged
merged 1 commit into from
Apr 19, 2018
Merged
Show file tree
Hide file tree
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
3 changes: 1 addition & 2 deletions daemon/mgr/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -1467,7 +1467,6 @@ func (mgr *ContainerManager) parseBinds(ctx context.Context, meta *ContainerMeta

for _, oldMountPoint := range oldMeta.Mounts {
mp := &types.MountPoint{
Name: oldMountPoint.Name,
Source: oldMountPoint.Source,
Destination: oldMountPoint.Destination,
Driver: oldMountPoint.Driver,
Expand All @@ -1476,7 +1475,7 @@ func (mgr *ContainerManager) parseBinds(ctx context.Context, meta *ContainerMeta
Propagation: oldMountPoint.Propagation,
}

if _, exist := meta.Config.Volumes[oldMountPoint.Name]; !exist {
if _, exist := meta.Config.Volumes[oldMountPoint.Name]; len(oldMountPoint.Name) > 0 && !exist {
mp.Name = oldMountPoint.Name
mp.Source, mp.Driver, err = mgr.bindVolume(ctx, oldMountPoint.Name, meta)
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions test/cli_run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -941,6 +941,7 @@ func (suite *PouchRunSuite) TestRunWithVolumesFrom(c *check.C) {
// run container1
command.PouchRun("run", "-d",
"-v", volumeName+":/mnt",
"-v", "/tmp:/tmp",
"--name", containerName1, busyboxImage, "top").Assert(c, icmd.Success)
defer func() {
command.PouchRun("rm", "-f", containerName1).Assert(c, icmd.Success)
Expand Down