LINBIT / virter

Virter is a command line tool for simple creation and cloning of virtual machines based on libvirt
Apache License 2.0
231 stars 12 forks source link

removing an image name with "--" issue #19

Closed bashfulrobot closed 1 year ago

bashfulrobot commented 1 year ago

Hi there. Dumb moves on my part.

When I was playing with images, before finding the default image names, I ran virter image pull https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64-disk-kvm.img not specifying a name. This resulted in an image named "--cloud-images.ubuntu.com--jammy--current--jammy-server-cloudimg-amd64-disk-kvm.img-latest".

Now when I tried to remove it (virter image rm --cloud-images.ubuntu.com--jammy--current--jammy-server-cloudimg-amd64-disk-kvm.img-latest), my shell (tried both fish and bash) complains about the flag not found. Ok. Expected. I tried quoting the name (' & ") and escaping as well. Same result.

So then I tried to remove the files in /var/lib/libvirt/images. That causes its own issues (failed to get the top layer). So I recreated them.

What is the best way to get around this? Or to manually clear out these entries (deleting in images does not do it completely).

A small suggestion might be to enforce either specifying the name or creating a more sane default without -- (or special characters) at the beginning. TBH, I am stumped why quoting is not working.

Thank you.

bashfulrobot commented 1 year ago

annndddd I just managed to remove it.

virter image rm -- --cloud-images.ubuntu.com--jammy--current--jammy-server-cloudimg-amd64-disk-kvm.img-latest