client/image_list: Wrap options and result

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
This commit is contained in:
Paweł Gronowski
2025-10-20 17:28:21 +02:00
committed by Austin Vazquez
parent a7f409014f
commit b3974f07f5
15 changed files with 61 additions and 47 deletions

View File

@@ -94,10 +94,10 @@ func getAllContainers(ctx context.Context, t testing.TB, apiClient client.Contai
func deleteAllImages(ctx context.Context, t testing.TB, apiclient client.ImageAPIClient, protectedImages map[string]struct{}) {
t.Helper()
images, err := apiclient.ImageList(ctx, client.ImageListOptions{})
imageList, err := apiclient.ImageList(ctx, client.ImageListOptions{})
assert.Check(t, err, "failed to list images")
for _, img := range images {
for _, img := range imageList.Items {
tags := tagsFromImageSummary(img)
if _, ok := protectedImages[img.ID]; ok {
continue

View File

@@ -205,7 +205,7 @@ func (e *Execution) HasExistingImage(t testing.TB, reference string) bool {
})
assert.NilError(t, err, "failed to list images")
return len(imageList) > 0
return len(imageList.Items) > 0
}
// EnsureFrozenImagesLinux loads frozen test images into the daemon

View File

@@ -121,7 +121,7 @@ func getExistingImages(ctx context.Context, t testing.TB, testEnv *Execution) []
assert.NilError(t, err, "failed to list images")
var images []string
for _, img := range imageList {
for _, img := range imageList.Items {
images = append(images, tagsFromImageSummary(img)...)
}
return images