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:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user