fix: prune missing image indexes and align instance creation payload
This commit is contained in:
@@ -93,22 +93,19 @@ func TestImageIndexDoesNotUndoConcurrentDelete(t *testing.T) {
|
||||
if im.ImageID == id {
|
||||
matches++
|
||||
}
|
||||
if im.ImageID == id && im.Status != "missing" {
|
||||
t.Errorf("returned deleted image as %s", im.Status)
|
||||
}
|
||||
}
|
||||
if matches != 1 {
|
||||
t.Errorf("returned %d records for deleted image, want 1", matches)
|
||||
if matches != 0 {
|
||||
t.Errorf("returned %d records for deleted image, want 0", matches)
|
||||
}
|
||||
case <-ctx.Done():
|
||||
t.Fatal("index did not finish")
|
||||
}
|
||||
var status string
|
||||
if err := a.s.DB.QueryRow("SELECT status FROM images WHERE image_id=?", id).Scan(&status); err != nil {
|
||||
var count int
|
||||
if err := a.s.DB.QueryRow("SELECT count(*) FROM images WHERE image_id=?", id).Scan(&count); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if status != "missing" {
|
||||
t.Errorf("persisted deleted image as %s", status)
|
||||
if count != 0 {
|
||||
t.Errorf("persisted %d rows for deleted image", count)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user