mirror of
https://github.com/docker/compose.git
synced 2025-07-22 21:24:38 +02:00
Add defensive code
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
This commit is contained in:
parent
657e89449a
commit
cd233ceb5c
@ -315,6 +315,9 @@ func getVolumesFrom(project *types.Project, volumesFrom []string) ([]string, []s
|
|||||||
}
|
}
|
||||||
for _, vol := range volumesFrom {
|
for _, vol := range volumesFrom {
|
||||||
spec := strings.Split(vol, ":")
|
spec := strings.Split(vol, ":")
|
||||||
|
if len(spec) == 0 {
|
||||||
|
continue
|
||||||
|
}
|
||||||
if spec[0] == "container" {
|
if spec[0] == "container" {
|
||||||
volumes = append(volumes, strings.Join(spec[1:], ":"))
|
volumes = append(volumes, strings.Join(spec[1:], ":"))
|
||||||
continue
|
continue
|
||||||
|
Loading…
x
Reference in New Issue
Block a user