mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-19 02:37:24 +08:00
fix: image upload not clean pending usage
This commit is contained in:
@@ -252,7 +252,7 @@ func init() {
|
||||
}
|
||||
|
||||
type ImageDeleteOptions struct {
|
||||
ID []string `help:"Image ID or name"`
|
||||
ID []string `help:"Image ID or name" json:"-"`
|
||||
OverridePendingDelete *bool `help:"Delete image directly instead of pending delete" short-token:"f"`
|
||||
}
|
||||
R(&ImageDeleteOptions{}, "image-delete", "Delete a image", func(s *mcclient.ClientSession, args *ImageDeleteOptions) error {
|
||||
|
||||
@@ -538,7 +538,8 @@ func (self *SImage) PostCreate(ctx context.Context, userCred mcclient.TokenCrede
|
||||
// if SImage belong to a guest image, pending quota will not be set.
|
||||
if self.IsGuestImage.IsFalse() {
|
||||
pendingUsage := SQuota{Image: 1}
|
||||
keys := imageCreateInput2QuotaKeys(self.DiskFormat, ownerId)
|
||||
inputDiskFormat, _ := data.GetString("disk_format")
|
||||
keys := imageCreateInput2QuotaKeys(inputDiskFormat, ownerId)
|
||||
pendingUsage.SetKeys(keys)
|
||||
cancelUsage := SQuota{Image: 1}
|
||||
keys = self.GetQuotaKeys()
|
||||
|
||||
Reference in New Issue
Block a user