mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
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:
committed by
Austin Vazquez
parent
a7f409014f
commit
b3974f07f5
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user