Skip to content

Commit

Permalink
Merge pull request #12430 from monstermunchkin/misc/patches
Browse files Browse the repository at this point in the history
lxd/patches: Add cluster check for patches fixing volumes
  • Loading branch information
tomponline authored Oct 20, 2023
2 parents 6ab06f9 + c525e53 commit 836dc05
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion lxd/patches.go
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,11 @@ func patchStorageRenameCustomISOBlockVolumes(name string, d *Daemon) error {
}

for _, vol := range volumes {
// In a non-clusted environment ServerName will be empty.
if s.ServerName != "" && vol.Location != s.ServerName {
continue
}

// Exclude non-ISO custom volumes.
if vol.ContentType != db.StoragePoolVolumeContentTypeNameISO {
continue
Expand Down Expand Up @@ -907,6 +912,11 @@ func patchZfsSetContentTypeUserProperty(name string, d *Daemon) error {
}

for _, vol := range volumes {
// In a non-clusted environment ServerName will be empty.
if s.ServerName != "" && vol.Location != s.ServerName {
continue
}

zfsPoolName := p.Driver().Config()["zfs.pool_name"]
if zfsPoolName != "" {
poolName = zfsPoolName
Expand Down Expand Up @@ -986,7 +996,8 @@ func patchStorageZfsUnsetInvalidBlockSettings(_ string, d *Daemon) error {

for pool, volumes := range poolVolumes {
for _, vol := range volumes {
if vol.Location != s.ServerName {
// In a non-clusted environment ServerName will be empty.
if s.ServerName != "" && vol.Location != s.ServerName {
continue
}

Expand Down

0 comments on commit 836dc05

Please sign in to comment.