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

Method containersByService

pkg/compose/observed_state.go:248–261  ·  view source on GitHub ↗

containersByService flattens the observed containers into the shape resolveServiceReferences expects: project service name → raw Summaries.

()

Source from the content-addressed store, hash-verified

246// containersByService flattens the observed containers into the shape
247// resolveServiceReferences expects: project service name → raw Summaries.
248func (s *ObservedState) containersByService() map[string]Containers {
249 if s == nil {
250 return map[string]Containers{}
251 }
252 result := make(map[string]Containers, len(s.Containers))
253 for svc, ocs := range s.Containers {
254 summaries := make(Containers, len(ocs))
255 for i, oc := range ocs {
256 summaries[i] = oc.Summary
257 }
258 result[svc] = summaries
259 }
260 return result
261}

Callers 2

newPlanExecutorMethod · 0.80
reconcileFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected