summaryrefslogtreecommitdiff
path: root/pkg/varlinkapi
diff options
context:
space:
mode:
authorNalin Dahyabhai <nalin@redhat.com>2019-04-22 16:41:17 -0400
committerNalin Dahyabhai <nalin@redhat.com>2019-04-25 08:57:58 -0400
commit5c81a117f16fde190acef331f5b88022fe11c550 (patch)
treea8aa0f3baaf59bf05e10479abc5a1d89206a0e80 /pkg/varlinkapi
parentb01fdcbbd5344e89c3d9f3462c1df1764277d9fd (diff)
downloadpodman-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 'pkg/varlinkapi')
-rw-r--r--pkg/varlinkapi/images.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/pkg/varlinkapi/images.go b/pkg/varlinkapi/images.go
index 470eadaeb..cecddf6b3 100644
--- a/pkg/varlinkapi/images.go
+++ b/pkg/varlinkapi/images.go
@@ -4,6 +4,7 @@ package varlinkapi
import (
"bytes"
+ "context"
"encoding/json"
"fmt"
"io"
@@ -49,7 +50,7 @@ func (i *LibpodAPI) ListImages(call iopodman.VarlinkCall) error {
}
size, _ := image.Size(getContext())
- isParent, err := image.IsParent()
+ isParent, err := image.IsParent(context.TODO())
if err != nil {
return call.ReplyErrorOccurred(err.Error())
}
@@ -503,7 +504,7 @@ func (i *LibpodAPI) DeleteUnusedImages(call iopodman.VarlinkCall) error {
return call.ReplyErrorOccurred(err.Error())
}
if len(containers) == 0 {
- if err := img.Remove(false); err != nil {
+ if err := img.Remove(context.TODO(), false); err != nil {
return call.ReplyErrorOccurred(err.Error())
}
deletedImages = append(deletedImages, img.ID())
@@ -739,7 +740,7 @@ func (i *LibpodAPI) ContainerRunlabel(call iopodman.VarlinkCall, input iopodman.
// ImagesPrune ....
func (i *LibpodAPI) ImagesPrune(call iopodman.VarlinkCall, all bool) error {
- prunedImages, err := i.Runtime.ImageRuntime().PruneImages(all)
+ prunedImages, err := i.Runtime.ImageRuntime().PruneImages(context.TODO(), all)
if err != nil {
return call.ReplyErrorOccurred(err.Error())
}