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

Method reconcileOrphans

pkg/compose/reconcile.go:813–829  ·  view source on GitHub ↗

reconcileOrphans plans stop + remove for orphaned containers.

()

Source from the content-addressed store, hash-verified

811
812// reconcileOrphans plans stop + remove for orphaned containers.
813func (r *reconciler) reconcileOrphans() {
814 for i, oc := range r.observed.Orphans {
815 stopNode := r.plan.addNode(Operation{
816 Type: OpStopContainer,
817 ResourceID: fmt.Sprintf("orphan:%s", oc.Name),
818 Cause: "orphaned container",
819 Container: &r.observed.Orphans[i].Summary,
820 Timeout: r.options.Timeout,
821 }, "")
822 r.plan.addNode(Operation{
823 Type: OpRemoveContainer,
824 ResourceID: fmt.Sprintf("orphan:%s", oc.Name),
825 Cause: "orphaned container",
826 Container: &r.observed.Orphans[i].Summary,
827 }, "", stopNode)
828 }
829}
830
831// observedSummaries returns the raw container.Summary list for a service,
832// needed by nextContainerNumber which expects []container.Summary.

Callers 1

reconcileFunction · 0.95

Calls 1

addNodeMethod · 0.80

Tested by

no test coverage detected