Err returns a non-nil error aggregating per-node hard failures (Status == "error"). Queued nodes (waiting for reconciler retry) are not failures — surfacing them as errors would mislead users about durable intent. Used by Install/Upgrade/Delete so reply.Success=false from workers reaches OpStatus.Er
()
| 104 | // workers reaches OpStatus.Error and the UI, instead of being silently |
| 105 | // dropped on the way up. |
| 106 | func (r BackendOpResult) Err() error { |
| 107 | var failures []string |
| 108 | for _, n := range r.Nodes { |
| 109 | if n.Status == galleryop.NodeStatusError { |
| 110 | failures = append(failures, fmt.Sprintf("%s: %s", n.NodeName, n.Error)) |
| 111 | } |
| 112 | } |
| 113 | if len(failures) == 0 { |
| 114 | return nil |
| 115 | } |
| 116 | return errors.New(strings.Join(failures, "; ")) |
| 117 | } |
| 118 | |
| 119 | // enqueueAndDrainBackendOp is the shared scaffolding for |
| 120 | // delete/install/upgrade. Every non-pending node gets a pending_backend_ops |
no outgoing calls