emitRunningEvents emits "Running" progress events for containers that are already running and have no operations planned for them. This matches the previous behavior where convergence.ensureService emitted runningEvent for up-to-date containers. Iterates project.Services (not observed.Containers) s
(project *types.Project, observed *ObservedState, plan *Plan, events api.EventProcessor)
| 218 | // disabled services (e.g. dependencies untouched by `compose run --no-deps`) |
| 219 | // are not falsely reported as Running — see issue 13882. |
| 220 | func emitRunningEvents(project *types.Project, observed *ObservedState, plan *Plan, events api.EventProcessor) { |
| 221 | planned := map[string]bool{} |
| 222 | for _, node := range plan.Nodes { |
| 223 | if node.Operation.Container != nil { |
| 224 | planned[node.Operation.Container.ID] = true |
| 225 | } |
| 226 | } |
| 227 | |
| 228 | for _, svc := range project.Services { |
| 229 | for _, oc := range observed.Containers[svc.Name] { |
| 230 | if oc.State == container.StateRunning && !planned[oc.ID] { |
| 231 | events.On(newEvent("Container "+oc.Name, api.Done, api.StatusRunning)) |
| 232 | } |
| 233 | } |
| 234 | } |
| 235 | } |
| 236 | |
| 237 | // orphanNames returns the names of orphaned containers as a comma-separated string. |
| 238 | func (s *ObservedState) orphanNames() string { |