(service *types.ServiceConfig, containersByService map[string]Containers)
| 71 | } |
| 72 | |
| 73 | func resolveVolumeFrom(service *types.ServiceConfig, containersByService map[string]Containers) error { |
| 74 | for i, vol := range service.VolumesFrom { |
| 75 | spec := strings.Split(vol, ":") |
| 76 | if len(spec) == 0 { |
| 77 | continue |
| 78 | } |
| 79 | if spec[0] == "container" { |
| 80 | service.VolumesFrom[i] = spec[1] |
| 81 | continue |
| 82 | } |
| 83 | name := spec[0] |
| 84 | dependencies := containersByService[name] |
| 85 | if len(dependencies) == 0 { |
| 86 | return fmt.Errorf("cannot share volume with service %s: container missing", name) |
| 87 | } |
| 88 | service.VolumesFrom[i] = dependencies.sorted()[0].ID |
| 89 | } |
| 90 | return nil |
| 91 | } |
| 92 | |
| 93 | func resolveSharedNamespaces(service *types.ServiceConfig, containersByService map[string]Containers) error { |
| 94 | if name := getDependentServiceFromMode(service.NetworkMode); name != "" { |
no test coverage detected