fix(api): /deckies/deploy becomes additive by default

The wizard POSTs only the new decky on each submit. The handler used to
treat every INI as the complete desired fleet (config.deckies = INI) so
the reconciler tore down prior deckies as orphans — deploying a second
Windows workstation silently wiped the first.

Add replace_fleet to DeployIniRequest (default false). Default path
merges new deckies into existing config and rejects name/IP collisions
with 409. replace_fleet=true preserves set-desired-state semantics for
CLI / declarative callers. Lifecycle rows are created only for the
deckies submitted in the current call, so /deckies/lifecycle?ids=...
reflects exactly what this submit deployed.

build_deckies_from_ini gains reserved_ips so additive auto-allocation
skips IPs already held by the existing fleet.
This commit is contained in:
2026-05-22 18:14:50 -04:00
parent 5b13a01ab6
commit 1b90048715
5 changed files with 237 additions and 10 deletions

View File

@@ -236,7 +236,7 @@ export const DeployWizard: React.FC<Props> = ({
try {
const res = await api.post<{ lifecycle_ids?: string[]; message?: string; mode?: string }>(
'/deckies/deploy',
{ ini_content: ini },
{ ini_content: ini, replace_fleet: false },
);
const ids = res.data?.lifecycle_ids ?? [];
setLifecycleIds(ids);