Skip to content

Commit

Permalink
lxd/storage/backend_lxd: Ensure new images have a volatile.UUID
Browse files Browse the repository at this point in the history
Signed-off-by: Julian Pelizäus <julian.pelizaeus@canonical.com>
  • Loading branch information
roosterfish committed Mar 15, 2024
1 parent 8021fa9 commit c309ce8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lxd/storage/backend_lxd.go
Original file line number Diff line number Diff line change
Expand Up @@ -3598,12 +3598,16 @@ func (b *lxdBackend) EnsureImage(fingerprint string, op *operations.Operation) e
return err
}

// Reset img volume variables as we just deleted the old one.
// Reset img volume as we just deleted the old one.
imgDBVol = nil
imgVol = b.GetVolume(drivers.VolumeTypeImage, contentType, fingerprint, nil)
}
}

if imgDBVol == nil {
// Instantiate a new volume including its own UUID.
imgVol = b.GetNewVolume(drivers.VolumeTypeImage, contentType, fingerprint, nil)
}

// Check if we already have a suitable volume on storage device.
volExists, err := b.driver.HasVolume(imgVol)
if err != nil {
Expand Down

0 comments on commit c309ce8

Please sign in to comment.