Skip to content

Commit

Permalink
[lxd-import] lxd/patches: Only update volumes that need updating in p…
Browse files Browse the repository at this point in the history
…atchStorageZfsUnsetInvalidBlockSettings

Signed-off-by: Thomas Hipp <thomas.hipp@canonical.com>
  • Loading branch information
monstermunchkin authored and stgraber committed Oct 20, 2023
1 parent 110770c commit a3d5b5a
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions cmd/incusd/patches.go
Original file line number Diff line number Diff line change
Expand Up @@ -956,8 +956,18 @@ func patchStorageZfsUnsetInvalidBlockSettings(_ string, d *Daemon) error {
continue
}

delete(config, "block.filesystem")
delete(config, "block.mount_options")
update := false
for _, k := range []string{"block.filesystem", "block.mount_options"} {
_, found := config[k]
if found {
delete(config, k)
update = true
}
}

if !update {
continue
}

if vol.Type == db.StoragePoolVolumeTypeNameVM {
volType = volTypeVM
Expand Down

0 comments on commit a3d5b5a

Please sign in to comment.