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

Method servicesUsingNetwork

pkg/compose/reconcile.go:327–336  ·  view source on GitHub ↗

servicesUsingNetwork returns the names of services that reference the given compose network key, sorted for deterministic plan output.

(networkKey string)

Source from the content-addressed store, hash-verified

325// servicesUsingNetwork returns the names of services that reference the given
326// compose network key, sorted for deterministic plan output.
327func (r *reconciler) servicesUsingNetwork(networkKey string) []string {
328 var names []string
329 for _, key := range sortedKeys(r.project.Services) {
330 svc := r.project.Services[key]
331 if _, ok := svc.Networks[networkKey]; ok {
332 names = append(names, svc.Name)
333 }
334 }
335 return names
336}
337
338// servicesUsingVolume returns the names of services that mount the given
339// compose volume key, sorted for deterministic plan output.

Callers 1

planRecreateNetworkMethod · 0.95

Calls 1

sortedKeysFunction · 0.85

Tested by

no test coverage detected