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

Method buildGroupTracker

pkg/compose/executor_events.go:39–61  ·  pkg/compose/executor_events.go::planExecutor.buildGroupTracker
(plan *Plan)

Source from the content-addressed store, hash-verified

37}
38
39func (exec *planExecutor) buildGroupTracker(plan *Plan) *groupTracker {
40 gt := &groupTracker{groups: map[string]*groupState{}}
41 for _, node := range plan.Nodes {
42 if node.Group == "" {
43 continue
44 }
45 if _, ok := gt.groups[node.Group]; !ok {
46 gt.groups[node.Group] = &groupState{}
47 }
48 gt.groups[node.Group].total++
49 // Pick the event name from a node that has the existing container reference
50 if gt.groups[node.Group].eventName == "" && node.Operation.Container != nil {
51 gt.groups[node.Group].eventName = getContainerProgressName(*node.Operation.Container)
52 }
53 }
54 // Fallback for groups where no node had a Container (shouldn't happen for recreate)
55 for name, gs := range gt.groups {
56 if gs.eventName == "" {
57 gs.eventName = name
58 }
59 }
60 return gt
61}
62
63func (gt *groupTracker) onNodeStart(node *PlanNode, events api.EventProcessor) {
64 if node.Group == "" {

Callers 1

runMethod · 0.95

Calls 1

getContainerProgressNameFunction · 0.85

Tested by

no test coverage detected