From 618f26ccbc3b5c314680dae4b09f5d13f9c02570 Mon Sep 17 00:00:00 2001 From: Brian Goff Date: Wed, 28 Sep 2022 19:43:45 +0000 Subject: Volume prune: only prune anonymous volumes by default This adds a new filter argument to the volume prune endpoint "all". When this is not set, or it is a false-y value, then only anonymous volumes are considered for pruning. When `all` is set to a truth-y value, you get the old behavior. This is an API change, but I think one that is what most people would want. Signed-off-by: Brian Goff Signed-off-by: Sebastiaan van Stijn --- docs/api/v1.42.yaml | 1 + docs/api/version-history.md | 1 + 2 files changed, 2 insertions(+) (limited to 'docs') diff --git a/docs/api/v1.42.yaml b/docs/api/v1.42.yaml index a0957ca7d4..9242952291 100644 --- a/docs/api/v1.42.yaml +++ b/docs/api/v1.42.yaml @@ -9689,6 +9689,7 @@ paths: Available filters: - `label` (`label=`, `label==`, `label!=`, or `label!==`) Prune volumes with (or without, in case `label!=...` is used) the specified labels. + - `all` (`all=true`) - Consider all (local) volumes for pruning and not just anonymous volumes. type: "string" responses: 200: diff --git a/docs/api/version-history.md b/docs/api/version-history.md index fb1db32f9c..573c80b77a 100644 --- a/docs/api/version-history.md +++ b/docs/api/version-history.md @@ -125,6 +125,7 @@ keywords: "API, Docker, rcli, REST, documentation" is set with a non-matching mount Type. * `POST /containers/{id}/exec` now accepts an optional `ConsoleSize` parameter. It allows to set the console size of the executed process immediately when it's created. +* `POST /volumes/prune` will now only prune "anonymous" volumes (volumes which were not given a name) by default. A new filter parameter `all` can be set to a truth-y value (`true`, `1`) to get the old behavior. ## v1.41 API changes -- cgit v1.2.1