Skip to content

Commit

Permalink
Address comments from Daniel and solve the lint error.
Browse files Browse the repository at this point in the history
Signed-off-by: Liping Xue <lipingxue@gmail.com>
  • Loading branch information
lipingxue committed Jul 7, 2017
1 parent 57a44fc commit 00f39c9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions cli/compose/convert/volume.go
Expand Up @@ -61,16 +61,19 @@ func convertVolumeToMount(
return result, errors.Errorf("undefined volume %q", volume.Source)
}

if stackVolume.External.External && stackVolume.External.Name != "" {
return result, errors.Errorf("cannot specify external volume name %q", stackVolume.External.Name)
}
result.Source = namespace.Scope(volume.Source)
result.VolumeOptions = &mount.VolumeOptions{}

if volume.Volume != nil {
result.VolumeOptions.NoCopy = volume.Volume.NoCopy
}

// External named volumes
if stackVolume.External.External {
result.Source = stackVolume.External.Name
return result, nil
}

if stackVolume.Name != "" {
result.Source = stackVolume.Name
}
Expand Down
2 changes: 1 addition & 1 deletion cli/compose/types/types.go
Expand Up @@ -305,7 +305,7 @@ type IPAMPool struct {

// VolumeConfig for a volume
type VolumeConfig struct {
Name string
Name string
Driver string
DriverOpts map[string]string `mapstructure:"driver_opts"`
External External
Expand Down

0 comments on commit 00f39c9

Please sign in to comment.