You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been very surprised by the unpredictable behaviour of the podman volume rm command.
It boils down to this:
$ podman volume create x
x
$ podman volume create xa
xa
$ podman volume rm x
x
$ podman volume rm x
xa
Podman deletes the volume "xa". Obviously this is a constructed example, but in practice, just running "podman volume rm x" again if you're were interrupted and not sure if you already did it, probably happens.
The function of the "rm" command is so obvious that I don't actually look up the manpage if I don't want some special behaviour. The manpage actually documents that behaviour:
Volumes can be removed individually by providing their full name or a unique partial name.
I think guessing what a user wants to delete is pretty dangerous and makes it unpredictable.
If I copy a volume to backup its contents, I cannot give it a similar name as "forgejo-backup" could be removed, because I run "podman rm forgejo". Am I sure no automatic process has removed the production volume while I was busy? Are there any automatic cleanup jobs running, that might cause me to remove the backup instead of the volume I specify?
/bin/rm removes exactly what you tell it to remove. Which is obviously were "podman volume rm" got its name.
I believe "podman volume rm" should behave the same, at least by default.
The guesswork that "podman volume rm" is doing probably saved someone some keystrokes. I'd argue that's the point of tab completion, but I think the guesswork should be opt-in.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I've been very surprised by the unpredictable behaviour of the podman volume rm command.
It boils down to this:
Podman deletes the volume "xa". Obviously this is a constructed example, but in practice, just running "podman volume rm x" again if you're were interrupted and not sure if you already did it, probably happens.
The function of the "rm" command is so obvious that I don't actually look up the manpage if I don't want some special behaviour. The manpage actually documents that behaviour:
I think guessing what a user wants to delete is pretty dangerous and makes it unpredictable.
If I copy a volume to backup its contents, I cannot give it a similar name as "forgejo-backup" could be removed, because I run "podman rm forgejo". Am I sure no automatic process has removed the production volume while I was busy? Are there any automatic cleanup jobs running, that might cause me to remove the backup instead of the volume I specify?
/bin/rm removes exactly what you tell it to remove. Which is obviously were "podman volume rm" got its name.
I believe "podman volume rm" should behave the same, at least by default.
The guesswork that "podman volume rm" is doing probably saved someone some keystrokes. I'd argue that's the point of tab completion, but I think the guesswork should be opt-in.
Beta Was this translation helpful? Give feedback.
All reactions