parentNamespaceRecreated reports whether any namespace- or volume-sharing parent of svc has at least one container scheduled for recreation. The parent set is derived from svc itself (network_mode/ipc/pid and volumes_from) rather than depends_on, so the cascade fires only when a stale "container:<id
(svc types.ServiceConfig)
| 565 | // rather than depends_on, so the cascade fires only when a stale |
| 566 | // "container:<id>" reference would otherwise be left behind. |
| 567 | func (r *reconciler) parentNamespaceRecreated(svc types.ServiceConfig) bool { |
| 568 | for _, mode := range []string{svc.NetworkMode, svc.Ipc, svc.Pid} { |
| 569 | if name := getDependentServiceFromMode(mode); name != "" && r.recreatedServices[name] { |
| 570 | return true |
| 571 | } |
| 572 | } |
| 573 | for _, vol := range svc.VolumesFrom { |
| 574 | if strings.HasPrefix(vol, types.ContainerPrefix) { |
| 575 | continue |
| 576 | } |
| 577 | name, _, _ := strings.Cut(vol, ":") |
| 578 | if r.recreatedServices[name] { |
| 579 | return true |
| 580 | } |
| 581 | } |
| 582 | return false |
| 583 | } |
| 584 | |
| 585 | // serviceHashWithResolvedRefs mirrors what the executor persists at create |
| 586 | // time: service references (network_mode/ipc/pid: service:X, volumes_from) are |
no test coverage detected