Keep the account of the sent declaration over an older one (hq issue 267)
The last report stored per node decides whether a release plan moves on, and it was whichever arrived last. A report about a declaration the mesh has moved past now records what it says about the machine but leaves the account of the apply alone, so arrival order cannot undo the newer.
This commit is contained in:
@@ -851,9 +851,9 @@ func (i *Inventory) DoingOf(ctx context.Context, name string) (Doing, bool, erro
|
||||
var d Doing
|
||||
var failed []byte
|
||||
err = i.store.Pool().QueryRow(ctx,
|
||||
`select outcome, refused, failed, applied, at, failing_since, failures
|
||||
`select outcome, refused, failed, applied, at, failing_since, failures, coalesce(declared, '')
|
||||
from node_report where node = $1`, node.ID).
|
||||
Scan(&d.Outcome, &d.Refused, &failed, &d.Applied, &d.At, &d.Since, &d.Times)
|
||||
Scan(&d.Outcome, &d.Refused, &failed, &d.Applied, &d.At, &d.Since, &d.Times, &d.Declared)
|
||||
if errors.Is(err, pgx.ErrNoRows) {
|
||||
return Doing{}, false, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user