podman-py icon indicating copy to clipboard operation
podman-py copied to clipboard

ImagesManager.prune() - no support for query-params/kwargs?

Open Dsafe1 opened this issue 2 years ago • 3 comments

Hello.

I am building a small application to manage my images and thus tried to prune ALL images not in use by using ImagesManager.prune(). Podman specifies this as possible via the "all" query parameter.

At first I struggled because I didn't realize that the "filters" argument is something else entirely, and that there is (afaik) no way to pass the "all" parameter to perform a full image prune. Is my assessment correct or am I missing something? If yes, then why is it this way? Wouldn't it be much more flexible to enable arbitrary query params for all routes so the user can talk to the entire Podman API using this library?

Dsafe1 avatar Aug 09 '23 09:08 Dsafe1

Hey,

If yes, then why is it this way? Wouldn't it be much more flexible to enable arbitrary query params for all routes so the user can talk to the entire Podman API using this library?

Implementing external, all, and filters params makes sense to me. @jwhonce wdyt?

inknos avatar Jun 03 '24 15:06 inknos

@inknos Adding external and all as kwargs would require extra validation if the client has been instantiated in compatible_version mode. That is, the client is running without the libpod extensions. Or, should we allow a compatible server to handle extra API parameters? Otherwise, seems like a good idea to me.

filters has already been implemented for the compatible entries. Adding the libpod label filter would complete the extensions.

jwhonce avatar Jun 04 '24 17:06 jwhonce

would require extra validation if the client has been instantiated in compatible_version mode

I would pursue this path.

Adding the libpod label filter would complete the extensions.

This also makes sense to me

inknos avatar Jun 06 '24 14:06 inknos