feat: start on a blank container — spawn with empty:true and no repo (skip clone, default worker image); Spawn UI enables blank spawn without repo selection

This commit is contained in:
2026-09-02 09:24:54 +00:00
parent c8cde3ff89
commit 0f245c9ee2
6 changed files with 105 additions and 28 deletions
+21
View File
@@ -1348,3 +1348,24 @@ func TestSpawnerEmptyScratch(t *testing.T) {
t.Fatalf("sessions volume missing: %v", binds)
}
}
func TestSpawnerEmptyScratchNoRepo(t *testing.T) {
f := newFakeDocker()
sp, _ := newTestSpawner(t, f)
res, err := sp.Start(context.Background(), "", "", "", true)
if err != nil {
t.Fatalf("Start with no repo: %v", err)
}
waitJobState(t, sp, res.SessionID, stateRunning)
creates := f.createsByName("lvmh-agent-")
if len(creates) != 1 {
t.Fatalf("creates = %d, want 1", len(creates))
}
for _, b := range creates[0].HostConfig.Binds {
if b == "lvmh-sessions:/pi-sessions" || b == "lvmh-pi-cache:/root/.pi/agent/cache" {
continue
}
t.Fatalf("blank spawn must mount no repo volume: %v", creates[0].HostConfig.Binds)
}
}