summaryrefslogtreecommitdiff
path: root/pkg/machine
diff options
context:
space:
mode:
authorAditya R <arajan@redhat.com>2022-04-12 15:33:27 +0530
committerAditya R <arajan@redhat.com>2022-04-12 16:44:29 +0530
commit8fb9dbdb4e194b2aa4b20b7ea16d1d21393bbaa3 (patch)
treed3686cbc397c04174492db5bb6064d01b8f7ea99 /pkg/machine
parent0ebd2882f48155daf7b4cc8acbe53a570ac1aceb (diff)
downloadpodman-8fb9dbdb4e194b2aa4b20b7ea16d1d21393bbaa3.tar.gz
podman-8fb9dbdb4e194b2aa4b20b7ea16d1d21393bbaa3.tar.bz2
podman-8fb9dbdb4e194b2aa4b20b7ea16d1d21393bbaa3.zip
machine,rm: Ignore ENOENT while cleaning machine
Certain paths like `../containers/podman/machine/my-test/podman.sock` do not exist when machine is not started, so removing a machine before starting it will result in ENOENT which we should ignore cause these paths do not exists Closes: https://github.com/containers/podman/issues/13834 [NO TESTS NEEDED] [NO NEW TESTS NEEDED] Signed-off-by: Aditya R <arajan@redhat.com>
Diffstat (limited to 'pkg/machine')
-rw-r--r--pkg/machine/qemu/machine.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/pkg/machine/qemu/machine.go b/pkg/machine/qemu/machine.go
index e849bae3f..321c1b99c 100644
--- a/pkg/machine/qemu/machine.go
+++ b/pkg/machine/qemu/machine.go
@@ -859,6 +859,9 @@ func (v *MachineVM) Remove(_ string, opts machine.RemoveOptions) (string, func()
return confirmationMessage, func() error {
for _, f := range files {
if err := os.Remove(f); err != nil {
+ if errors.Is(err, os.ErrNotExist) {
+ continue
+ }
logrus.Error(err)
}
}