store: fix FindActiveByMAC scanning profile column that wasn't selected
CI / Lint + build + test (push) Successful in 1m40s
Release / release (push) Has been cancelled

Sibling Run-scan sites (Get, LatestForHost, ListForHost, Active) were
updated to include COALESCE(profile,'quick') in the SELECT when the
Phase 1 migration added the column; FindActiveByMAC was missed, so
Scan got 14 destination args for a 13-column row. The symptom is
/ipxe/{mac} returning 500 and the host booting nothing, since that
handler is what returns the live-image script.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-04-19 20:14:16 -04:00
parent 75c29bb31a
commit bbe1b19819
+2 -1
View File
@@ -283,7 +283,8 @@ func (r *Runs) FindActiveByMAC(ctx context.Context, mac string) (*model.Run, err
SELECT r.id, r.host_id, r.state, COALESCE(r.result,''), COALESCE(r.failed_stage,''),
COALESCE(r.next_boot_target,''), r.agent_token_hash, r.started_at,
r.completed_at, COALESCE(r.report_path,''), COALESCE(r.hold_ip,''),
COALESCE(r.override_flags_json,''), COALESCE(r.non_destructive,0)
COALESCE(r.override_flags_json,''), COALESCE(r.non_destructive,0),
COALESCE(r.profile,'quick')
FROM runs r
JOIN hosts h ON h.id = r.host_id
WHERE h.mac = ? AND r.state NOT IN ('Completed','Released','Cancelled')