allow filter networks by dangling status

add the ability to filter networks by their dangling status via:

`network ls --filter dangling=true/false`

Fixes: #14595
Signed-off-by: Carlo Lobrano <c.lobrano@gmail.com>
This commit is contained in:
Carlo Lobrano
2022-06-17 09:54:22 +02:00
parent 78ecdad5f8
commit 4a981c490b
4 changed files with 86 additions and 25 deletions

View File

@ -25,6 +25,7 @@ Supported filters:
| label | Filter by network with (or without, in the case of label!=[...] is used) the specified labels. |
| name | Filter by network name (accepts `regex`). |
| until | Filter by networks created before given timestamp. |
| dangling | Filter by networks with no containers attached. |
The `driver` filter accepts values: `bridge`, `macvlan`, `ipvlan`.
@ -33,6 +34,8 @@ The `label` *filter* accepts two formats. One is the `label`=*key* or `label`=*k
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 `dangling` *filter* accepts values `true` or `false`.
#### **--format**=*format*
Change the default output format. This can be of a supported type like 'json'