diff --git a/src/backend/ci/core/store/biz-store-image/src/main/kotlin/com/tencent/devops/store/service/image/ImageReleaseService.kt b/src/backend/ci/core/store/biz-store-image/src/main/kotlin/com/tencent/devops/store/service/image/ImageReleaseService.kt index 9b2a952b4ca..0465803a8a6 100644 --- a/src/backend/ci/core/store/biz-store-image/src/main/kotlin/com/tencent/devops/store/service/image/ImageReleaseService.kt +++ b/src/backend/ci/core/store/biz-store-image/src/main/kotlin/com/tencent/devops/store/service/image/ImageReleaseService.kt @@ -406,12 +406,18 @@ abstract class ImageReleaseService { (cancelFlag && releaseType == ReleaseTypeEnum.CANCEL_RE_RELEASE)) { // 首次创建版本或者取消发布后不变更版本号重新上架,则在该版本的记录上做更新操作 imageId = imageRecord.id + val finalReleaseType = if (releaseType == ReleaseTypeEnum.CANCEL_RE_RELEASE) { + val imageVersion = marketImageVersionLogDao.getImageVersion(context, imageId) + imageVersion.releaseType + } else { + releaseType.releaseType.toByte() + } updateMarketImage( context = context, userId = userId, imageId = imageId, imageSize = "", - releaseType = releaseType.releaseType.toByte(), + releaseType = finalReleaseType, marketImageUpdateRequest = marketImageUpdateRequest ) } else {