mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
Merge pull request #896 in YUNIONIO/onecloud from ~QUXUAN/onecloud:hotfix/qx-delete-image to release/2.5.0
* commit 'de2f6c219f1a7c5f4879200fb8bbbb4cc39652ee': 避免删除非正常状态下image再次恢复时,镜像使用时会出现非预期状态
This commit is contained in:
@@ -533,6 +533,9 @@ func (self *SImage) CustomizeDelete(ctx context.Context, userCred mcclient.Token
|
||||
overridePendingDelete = jsonutils.QueryBoolean(query, "override_pending_delete", false)
|
||||
purge = jsonutils.QueryBoolean(query, "purge", false)
|
||||
}
|
||||
if self.Status != IMAGE_STATUS_ACTIVE {
|
||||
overridePendingDelete = true
|
||||
}
|
||||
return self.startDeleteImageTask(ctx, userCred, "", purge, overridePendingDelete)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user