From 650aac5c373274995966e48cdf33c8d6c4f87775 Mon Sep 17 00:00:00 2001 From: Thomas Parrott Date: Fri, 6 Oct 2023 09:57:43 +0100 Subject: [PATCH] [lxd-import] lxd/patches: Fix patchStorageRenameCustomISOBlockVolumes when no storage pools exist Signed-off-by: Thomas Parrott --- cmd/incusd/patches.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/incusd/patches.go b/cmd/incusd/patches.go index ae989f9b557..a3b0bfe40ed 100644 --- a/cmd/incusd/patches.go +++ b/cmd/incusd/patches.go @@ -736,6 +736,11 @@ func patchStorageRenameCustomISOBlockVolumes(name string, d *Daemon) error { // Get all storage pool names. pools, err := s.DB.Cluster.GetStoragePoolNames() if err != nil { + // Skip the rest of the patch if no storage pools were found. + if api.StatusErrorCheck(err, http.StatusNotFound) { + return nil + } + return fmt.Errorf("Failed getting storage pool names: %w", err) }