(plan *Plan)
| 37 | } |
| 38 | |
| 39 | func (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 | |
| 63 | func (gt *groupTracker) onNodeStart(node *PlanNode, events api.EventProcessor) { |
| 64 | if node.Group == "" { |
no test coverage detected