Add --all to artifact rm

Add the ability to remove all artifacts with a --all|-a option in podman
artifact rm.

Fixes: https://issues.redhat.com/browse/RUN-2512

Signed-off-by: Brent Baude <bbaude@redhat.com>
This commit is contained in:
Brent Baude
2025-02-18 16:21:38 -06:00
parent ca1c029c43
commit cbc73457ab
5 changed files with 129 additions and 29 deletions

View File

@ -9,7 +9,7 @@ subject to change.*
podman\-artifact\-rm - Remove an OCI from local storage
## SYNOPSIS
**podman artifact rm** *name*
**podman artifact rm** [*options*] *name*
## DESCRIPTION
@ -18,6 +18,11 @@ qualified artifact name or a full or partial artifact digest.
## OPTIONS
#### **--all**, **-a**
Remove all artifacts in the local store. The use of this option conflicts with
providing a name or digest of the artifact.
#### **--help**
Print usage statement.
@ -29,14 +34,21 @@ Remove an artifact by name
```
$ podman artifact rm quay.io/artifact/foobar2:test
e7b417f49fc24fc7ead6485da0ebd5bc4419d8a3f394c169fee5a6f38faa4056
Deleted: e7b417f49fc24fc7ead6485da0ebd5bc4419d8a3f394c169fee5a6f38faa4056
```
Remove an artifact by partial digest
```
$ podman artifact rm e7b417f49fc
e7b417f49fc24fc7ead6485da0ebd5bc4419d8a3f394c169fee5a6f38faa4056
Deleted: e7b417f49fc24fc7ead6485da0ebd5bc4419d8a3f394c169fee5a6f38faa4056
```
Remove all artifacts in local storage
```
$ podman artifact rm -a
Deleted: cee15f7c5ce3e86ae6ce60d84bebdc37ad34acfa9a2611cf47501469ac83a1ab
Deleted: 72875f8f6f78d5b8ba98b2dd2c0a6f395fde8f05ff63a1df580d7a88f5afa97b
```
## SEE ALSO