mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
Merge pull request #8464 from wanyaoqi/bugfix/wyq/check-disk-is-in-reset-before-delete-snapshot
bugfix:check disk is in reset before delete snapshot
This commit is contained in:
@@ -623,6 +623,11 @@ func (self *SSnapshot) ValidateDeleteCondition(ctx context.Context) error {
|
||||
if count > 0 {
|
||||
return httperrors.NewBadRequestError("snapshot referenced by instance snapshot")
|
||||
}
|
||||
if disk, err := self.GetDisk(); err == nil {
|
||||
if disk.Status == api.DISK_RESET {
|
||||
return httperrors.NewBadRequestError("Cannot delete snapshot on disk reset")
|
||||
}
|
||||
}
|
||||
driver := self.GetRegionDriver()
|
||||
if driver != nil {
|
||||
return driver.ValidateSnapshotDelete(ctx, self)
|
||||
|
||||
Reference in New Issue
Block a user