store: fix FindActiveByMAC scanning profile column that wasn't selected
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:
@@ -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,''),
|
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,
|
COALESCE(r.next_boot_target,''), r.agent_token_hash, r.started_at,
|
||||||
r.completed_at, COALESCE(r.report_path,''), COALESCE(r.hold_ip,''),
|
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
|
FROM runs r
|
||||||
JOIN hosts h ON h.id = r.host_id
|
JOIN hosts h ON h.id = r.host_id
|
||||||
WHERE h.mac = ? AND r.state NOT IN ('Completed','Released','Cancelled')
|
WHERE h.mac = ? AND r.state NOT IN ('Completed','Released','Cancelled')
|
||||||
|
|||||||
Reference in New Issue
Block a user