From b64c62ed93d045b22933b0e5a55f2d419194bf61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Graber?= Date: Tue, 17 Oct 2023 23:56:33 -0400 Subject: [PATCH] cmd/lxd-to-incus: Handle backups/images volumes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Graber --- cmd/lxd-to-incus/main.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/lxd-to-incus/main.go b/cmd/lxd-to-incus/main.go index 24b6dce207..8e035570d1 100644 --- a/cmd/lxd-to-incus/main.go +++ b/cmd/lxd-to-incus/main.go @@ -540,6 +540,11 @@ Instances will come back online once the migration is complete. // Cleanup paths. fmt.Println("=> Cleaning up target paths") + for _, dir := range []string{"backups", "images"} { + // Remove any potential symlink (ignore errors for real directories). + _ = os.Remove(filepath.Join(targetPaths.Daemon, dir)) + } + for _, dir := range []string{"devices", "devlxd", "security", "shmounts"} { err = os.RemoveAll(filepath.Join(targetPaths.Daemon, dir)) if err != nil && !os.IsNotExist(err) {