Hold a plan whose backup failed or stayed silent, say it, and ask again by a verb (issue 1066)

This commit is contained in:
2026-10-17 22:48:28 +02:00
parent 9a20547dbd
commit c531c78eb5
11 changed files with 513 additions and 1 deletions
+14 -1
View File
@@ -884,6 +884,19 @@ func deliveryCommand(ctx context.Context, args []string) error {
fmt.Printf("%s stopped by %s at tier %d of %d; what was asked still builds and registers, nothing further "+
"is asked or sent\n", p.ID, *by, p.Tier, len(p.Tiers))
return nil
case "backups-again":
if len(positionals) != 1 || strings.TrimSpace(*why) == "" {
return errors.New("delivery backups-again <plan> --why <text> [--by <who>]")
}
var p inventory.Plan
var again []inventory.PlanBackup
if err := sayingOnTheBus(ctx, inv, func() (err error) {
p, again, err = backupsAgain(ctx, inv, positionals[0], *by, strings.TrimSpace(*why))
return err
}); err != nil {
return err
}
return answer(map[string]any{"plan": p.ID, "asked_again": again})
case "walks":
var walks []inventory.Plan
if *planID != "" {
@@ -924,7 +937,7 @@ func deliveryCommand(ctx context.Context, args []string) error {
return answer(map[string]any{"held": deliverySeatHeld(entries), "walks": walks,
"own-path": sortedKeysOf(ownPathWords())})
}
return fmt.Errorf("delivery %s: plan, order, check, go, stop or walks", sub)
return fmt.Errorf("delivery %s: plan, order, check, go, stop, backups-again or walks", sub)
}
// appliedFrom answers a machine's own report of the send a walk made to it from the controller's `apply` durations