Skip to content

Commit

Permalink
Support external volumes
Browse files Browse the repository at this point in the history
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
  • Loading branch information
aanand committed Oct 25, 2016
1 parent ad53da4 commit c8d2c44
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions cli/command/stack/deploy.go
Expand Up @@ -218,21 +218,23 @@ func convertVolumes(
return nil, fmt.Errorf("Undefined volume: %s", source)
}

volumeOptions = &mount.VolumeOptions{
Labels: stackVolume.Labels,
}

if stackVolume.Driver != "" {
volumeOptions.DriverConfig = &mount.Driver{
Name: stackVolume.Driver,
Options: stackVolume.DriverOpts,
if stackVolume.ExternalName != "" {
source = stackVolume.ExternalName
} else {
volumeOptions = &mount.VolumeOptions{
Labels: stackVolume.Labels,
}
}

// TODO: handle external volumes
if stackVolume.Driver != "" {
volumeOptions.DriverConfig = &mount.Driver{
Name: stackVolume.Driver,
Options: stackVolume.DriverOpts,
}
}

// TODO: remove this duplication
source = fmt.Sprintf("%s_%s", namespace, source)
// TODO: remove this duplication
source = fmt.Sprintf("%s_%s", namespace, source)
}
}

mounts = append(mounts, mount.Mount{
Expand Down

0 comments on commit c8d2c44

Please sign in to comment.