reconcileOrphans plans stop + remove for orphaned containers.
()
| 811 | |
| 812 | // reconcileOrphans plans stop + remove for orphaned containers. |
| 813 | func (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. |