summaryrefslogtreecommitdiff
path: root/pkg/bindings/pods
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-04-18 06:02:51 -0400
committerGitHub <noreply@github.com>2020-04-18 06:02:51 -0400
commite4e42b28dfef0ffd12f2087048dec61f9cb03976 (patch)
treeebce391a95795cb5861f55380047923fa7184271 /pkg/bindings/pods
parent3b461ed6eb85f329ad163a4f18df3b872fe86f04 (diff)
parent37f3b191d5318b7d25893eabf4e57b568c326773 (diff)
downloadpodman-e4e42b28dfef0ffd12f2087048dec61f9cb03976.tar.gz
podman-e4e42b28dfef0ffd12f2087048dec61f9cb03976.tar.bz2
podman-e4e42b28dfef0ffd12f2087048dec61f9cb03976.zip
Merge pull request #5733 from sujil02/v2-pod-prune
Add pod prune for api v2
Diffstat (limited to 'pkg/bindings/pods')
-rw-r--r--pkg/bindings/pods/pods.go12
1 files changed, 7 insertions, 5 deletions
diff --git a/pkg/bindings/pods/pods.go b/pkg/bindings/pods/pods.go
index 83847614a..3c60fa2a0 100644
--- a/pkg/bindings/pods/pods.go
+++ b/pkg/bindings/pods/pods.go
@@ -98,17 +98,19 @@ func Pause(ctx context.Context, nameOrID string) (*entities.PodPauseReport, erro
return &report, response.Process(&report)
}
-// Prune removes all non-running pods in local storage.
-func Prune(ctx context.Context) error {
+// Prune by default removes all non-running pods in local storage.
+// And with force set true removes all pods.
+func Prune(ctx context.Context) ([]*entities.PodPruneReport, error) {
+ var reports []*entities.PodPruneReport
conn, err := bindings.GetClient(ctx)
if err != nil {
- return err
+ return nil, err
}
response, err := conn.DoRequest(nil, http.MethodPost, "/pods/prune", nil)
if err != nil {
- return err
+ return nil, err
}
- return response.Process(nil)
+ return reports, response.Process(&reports)
}
// List returns all pods in local storage. The optional filters parameter can