File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -61,16 +61,19 @@ func convertVolumeToMount(
61
61
return result , errors .Errorf ("undefined volume %q" , volume .Source )
62
62
}
63
63
64
- if stackVolume .External .External && stackVolume .External .Name != "" {
65
- return result , errors .Errorf ("cannot specify external volume name %q" , stackVolume .External .Name )
66
- }
67
64
result .Source = namespace .Scope (volume .Source )
68
65
result .VolumeOptions = & mount.VolumeOptions {}
69
66
70
67
if volume .Volume != nil {
71
68
result .VolumeOptions .NoCopy = volume .Volume .NoCopy
72
69
}
73
70
71
+ // External named volumes
72
+ if stackVolume .External .External {
73
+ result .Source = stackVolume .External .Name
74
+ return result , nil
75
+ }
76
+
74
77
if stackVolume .Name != "" {
75
78
result .Source = stackVolume .Name
76
79
}
Original file line number Diff line number Diff line change @@ -305,7 +305,7 @@ type IPAMPool struct {
305
305
306
306
// VolumeConfig for a volume
307
307
type VolumeConfig struct {
308
- Name string
308
+ Name string
309
309
Driver string
310
310
DriverOpts map [string ]string `mapstructure:"driver_opts"`
311
311
External External
You can’t perform that action at this time.
0 commit comments