Skip to content

Commit

Permalink
lxd/patches: Add cluster check for patches fixing volumes
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Hipp <[email protected]>
  • Loading branch information
monstermunchkin committed Oct 20, 2023
1 parent 6ab06f9 commit c525e53
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 c525e53

Please sign in to comment.