From 4b0f3b4dd14de3484499d9de70bfbbcbc177d8f9 Mon Sep 17 00:00:00 2001 From: Jian Qiu Date: Tue, 29 Jul 2025 10:26:09 +0800 Subject: [PATCH] fix: glance converts all queued subimages, regardless of format (#22971) Co-authored-by: Qiu Jian --- pkg/image/models/images.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkg/image/models/images.go b/pkg/image/models/images.go index 7803074f61..603625f94f 100644 --- a/pkg/image/models/images.go +++ b/pkg/image/models/images.go @@ -1102,8 +1102,10 @@ func (self *SImage) migrateSubImage(ctx context.Context) error { } if self.GetImageType() != api.ImageTypeISO && imgInst.IsSparse() && utils.IsInStringArray(self.DiskFormat, options.Options.TargetImageFormats) { // need to convert again + log.Debugf("migrateImage: image is not iso but sparse, need to convert the image") return self.newSubformat(ctx, qemuimgfmt.String2ImageFormat(self.DiskFormat), false) } else { + log.Debugf("migrateImage: no need to convert the image") localPath := self.GetLocalLocation() if !strings.HasSuffix(localPath, fmt.Sprintf(".%s", self.DiskFormat)) { newLocalpath := fmt.Sprintf("%s.%s", localPath, self.DiskFormat) @@ -1165,9 +1167,6 @@ func (self *SImage) doConvertAllSubformats() error { // cleanup continue } - if self.DiskFormat == subimgs[i].Format { - continue - } err := subimgs[i].doConvert(self) if err != nil { return errors.Wrap(err, "")