mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
Merge pull request #1226 in YUNIONIO/onecloud from ~QIUJIAN/onecloud:hotfix/qj-recover-image-properties-at-startup to release/2.7.0
* commit 'a54cba786541cb4c8debd9bde0ab39638c4d422a': fix: try to recover image properties(mindisk, format) at startup
This commit is contained in:
@@ -1033,7 +1033,7 @@ func (self *SImage) DoCheckStatus(ctx context.Context, userCred mcclient.TokenCr
|
||||
format := string(img.Format)
|
||||
virtualSizeMB := int32(img.SizeBytes / 1024 / 1024)
|
||||
if (len(format) > 0 && self.DiskFormat != format) || (virtualSizeMB > 0 && self.MinDiskMB != virtualSizeMB) {
|
||||
self.GetModelManager().TableSpec().Update(self, func() error {
|
||||
db.Update(self, func() error {
|
||||
if len(format) > 0 {
|
||||
self.DiskFormat = format
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user