Unify podman prune filter description: volumes, networks, system

follow up of #12976

Signed-off-by: Patrycja Guzik <patrycja.k.guzik@gmail.com>
This commit is contained in:
Patrycja Guzik 2022-01-25 22:20:48 +01:00 committed by Daniel J Walsh
parent 09589fccfd
commit 63b1557a25
No known key found for this signature in database
GPG Key ID: A2DF901DABE2C028
3 changed files with 32 additions and 19 deletions

View File

@ -18,17 +18,20 @@ Do not prompt for confirmation
#### **--filter** #### **--filter**
Filter output based on conditions given. Provide filter values.
Multiple filters can be given with multiple uses of the --filter option.
Filters with the same key work inclusive with the only exception being
`label` which is exclusive. Filters with different keys always work exclusive.
Valid filters are listed below: The *filters* argument format is of `key=value`. If there is more than one *filter*, then pass multiple OPTIONS: **--filter** *foo=bar* **--filter** *bif=baz*.
| **Filter** | **Description** | Supported filters:
| ---------- | ------------------------------------------------------------------------------------- |
| label | [Key] or [Key=Value] Label assigned to a network | | Filter | Description |
| until | only remove networks created before given timestamp | | :----------------: | --------------------------------------------------------------------------- |
| *until* | Only remove networks created before given timestamp. |
| *label* | Only remove networks, with (or without, in the case of label!=[...] is used) the specified labels. |
The `until` *filter* can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. 10m, 1h30m) computed relative to the machines time.
The `label` *filter* accepts two formats. One is the `label`=*key* or `label`=*key*=*value*, which removes networks with the specified labels. The other format is the `label!`=*key* or `label!`=*key*=*value*, which removes networks without the specified labels.
## EXAMPLE ## EXAMPLE
Prune networks Prune networks

View File

@ -22,16 +22,18 @@ Recursively remove all unused pod, container, image and volume data (Maximum 50
Provide filter values. Provide filter values.
The --filter flag format is of “key=value”. If there is more than one filter, then pass multiple flags (e.g., --filter "foo=bar" --filter "bif=baz") The *filters* argument format is of `key=value`. If there is more than one *filter*, then pass multiple OPTIONS: **--filter** *foo=bar* **--filter** *bif=baz*.
Supported filters: Supported filters:
- `until` (_timestamp_) - only remove containers and images created before given timestamp | Filter | Description |
- `label` (label=_key_, label=_key=value_, label!=_key_, or label!=_key=value_) - only remove containers and images, with (or without, in case label!=... is used) the specified labels. | :----------------: | --------------------------------------------------------------------------- |
| *until* | Only remove containers and images created before given timestamp. |
| *label* | Only remove containers and images, with (or without, in the case of label!=[...] is used) the specified labels. |
The until filter can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. 10m, 1h30m) computed relative to the machines time. The `until` *filter* can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. 10m, 1h30m) computed relative to the machines time.
The label filter accepts two formats. One is the label=... (label=_key_ or label=_key=value_), which removes containers and images with the specified labels. The other format is the label!=... (label!=_key_ or label!=_key=value_), which removes containers and images without the specified labels. The `label` *filter* accepts two formats. One is the `label`=*key* or `label`=*key*=*value*, which removes containers and images with the specified labels. The other format is the `label!`=*key* or `label!`=*key*=*value*, which removes containers and images without the specified labels.
#### **--force**, **-f** #### **--force**, **-f**

View File

@ -21,12 +21,20 @@ Do not prompt for confirmation.
#### **--filter** #### **--filter**
Filter volumes to be pruned. Volumes can be filtered by the following attributes: Provide filter values.
| **Filter** | **Description** | The *filters* argument format is of `key=value`. If there is more than one *filter*, then pass multiple OPTIONS: **--filter** *foo=bar* **--filter** *bif=baz*.
| ---------- | ------------------------------------------------------------------------------------- |
| label | [Key] or [Key=Value] Label assigned to a volume | Supported filters:
| until | Only remove volumes created before given timestamp |
| Filter | Description |
| :----------------: | --------------------------------------------------------------------------- |
| *until* | Only remove volumes created before given timestamp. |
| *label* | Only remove volumes, with (or without, in the case of label!=[...] is used) the specified labels. |
The `until` *filter* can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. 10m, 1h30m) computed relative to the machines time.
The `label` *filter* accepts two formats. One is the `label`=*key* or `label`=*key*=*value*, which removes volumes with the specified labels. The other format is the `label!`=*key* or `label!`=*key*=*value*, which removes volumes without the specified labels.
#### **--help** #### **--help**