diff options
author | Nalin Dahyabhai <nalin@redhat.com> | 2019-04-22 16:41:17 -0400 |
---|---|---|
committer | Nalin Dahyabhai <nalin@redhat.com> | 2019-04-25 08:57:58 -0400 |
commit | 5c81a117f16fde190acef331f5b88022fe11c550 (patch) | |
tree | a8aa0f3baaf59bf05e10479abc5a1d89206a0e80 /libpod/runtime_img.go | |
parent | b01fdcbbd5344e89c3d9f3462c1df1764277d9fd (diff) | |
download | podman-5c81a117f16fde190acef331f5b88022fe11c550.tar.gz podman-5c81a117f16fde190acef331f5b88022fe11c550.tar.bz2 podman-5c81a117f16fde190acef331f5b88022fe11c550.zip |
images: add context to GetParent/IsParent/Remove/Prune...
Add a context.Context parameter to Image.GetParent(), Image.IsParent(),
Image.GetChildren(), Image.Remove(), and Runtime.PruneImages().
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Diffstat (limited to 'libpod/runtime_img.go')
-rw-r--r-- | libpod/runtime_img.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libpod/runtime_img.go b/libpod/runtime_img.go index 02f925fc6..5e9f65acc 100644 --- a/libpod/runtime_img.go +++ b/libpod/runtime_img.go @@ -57,7 +57,7 @@ func (r *Runtime) RemoveImage(ctx context.Context, img *image.Image, force bool) } } - hasChildren, err := img.IsParent() + hasChildren, err := img.IsParent(ctx) if err != nil { return "", err } @@ -82,12 +82,12 @@ func (r *Runtime) RemoveImage(ctx context.Context, img *image.Image, force bool) // reponames and no force is applied, we error out. return "", fmt.Errorf("unable to delete %s (must force) - image is referred to in multiple tags", img.ID()) } - err = img.Remove(force) + err = img.Remove(ctx, force) if err != nil && errors.Cause(err) == storage.ErrImageUsedByContainer { if errStorage := r.rmStorageContainers(force, img); errStorage == nil { // Containers associated with the image should be deleted now, // let's try removing the image again. - err = img.Remove(force) + err = img.Remove(ctx, force) } else { err = errStorage } |