mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-10-30 18:23:35 +08:00
避免删除非正常状态下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