Skip to content

Commit

Permalink
lxd/patches: Only update volumes that need updating in patchStorageZf…
Browse files Browse the repository at this point in the history
…sUnsetInvalidBlockSettings

Signed-off-by: Thomas Hipp <thomas.hipp@canonical.com>
  • Loading branch information
monstermunchkin committed Oct 19, 2023
1 parent 5235a06 commit 942350e
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions lxd/patches.go
Original file line number Diff line number Diff line change
Expand Up @@ -996,8 +996,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 942350e

Please sign in to comment.