MCPcopy
hub / github.com/docker/compose / resolveServiceReferences

Function resolveServiceReferences

pkg/compose/convergence.go:66–71  ·  view source on GitHub ↗

resolveServiceReferences replaces references to other services with references to actual container IDs. It resolves VolumesFrom, NetworkMode, IPC and PID shared namespaces. The containersByService map provides the observed containers grouped by service name.

(service *types.ServiceConfig, containersByService map[string]Containers)

Source from the content-addressed store, hash-verified

64// shared namespaces. The containersByService map provides the observed containers
65// grouped by service name.
66func resolveServiceReferences(service *types.ServiceConfig, containersByService map[string]Containers) error {
67 if err := resolveVolumeFrom(service, containersByService); err != nil {
68 return err
69 }
70 return resolveSharedNamespaces(service, containersByService)
71}
72
73func resolveVolumeFrom(service *types.ServiceConfig, containersByService map[string]Containers) error {
74 for i, vol := range service.VolumesFrom {

Callers 3

execCreateContainerMethod · 0.85

Calls 2

resolveVolumeFromFunction · 0.85
resolveSharedNamespacesFunction · 0.85

Tested by

no test coverage detected