Allow version comparison errors (#2015)

Co-authored-by: inksnw <inksnw@gmail.com>
This commit is contained in:
KubeSphere CI Bot
2024-10-31 15:07:09 +08:00
committed by hongming
parent 128e7da6f3
commit 96f85d4500

View File

@@ -301,7 +301,12 @@ func UpdateLatestAppVersion(ctx context.Context, client runtimeclient.Client, ap
klog.Warningf("failed to parse version: %s, use first version %s", v.Spec.VersionName, latestAppVersion)
continue
}
if parsedVersion.GT(semver.MustParse(strings.TrimPrefix(latestAppVersion, "v"))) {
oldLatestAppVersion, err := semver.Parse(strings.TrimPrefix(latestAppVersion, "v"))
if err != nil {
klog.Warningf("failed to parse oldLatestAppVersion: %s", latestAppVersion)
continue
}
if parsedVersion.GT(oldLatestAppVersion) {
latestAppVersion = v.Spec.VersionName
}
}