Copilot commented on code in PR #14033:
URL: https://github.com/apache/cloudstack/pull/14033#discussion_r4012202167
##########
engine/schema/src/main/java/com/cloud/upgrade/DatabaseUpgradeChecker.java:
##########
@@ -513,8 +515,13 @@ protected void doUpgrades(GlobalLock lock) {
String csVersion = parseSystemVmMetadata();
final CloudStackVersion sysVmVersion =
CloudStackVersion.parse(csVersion);
final CloudStackVersion currentVersion =
CloudStackVersion.parse(currentVersionValue);
- SystemVmTemplateRegistration.CS_MAJOR_VERSION =
sysVmVersion.getMajorRelease() + "." + sysVmVersion.getMinorRelease();
- SystemVmTemplateRegistration.CS_TINY_VERSION =
String.valueOf(sysVmVersion.getPatchRelease());
+ if (sysVmVersion.usesNewVersioning()) {
+ SystemVmTemplateRegistration.CS_MAJOR_VERSION =
String.valueOf(sysVmVersion.getMajorRelease());
+ SystemVmTemplateRegistration.CS_TINY_VERSION =
String.valueOf(sysVmVersion.getMinorRelease());
Review Comment:
For a new-versioning metadata value such as `24.0.0`, `sysVmVersion` has
major=24, minor=0, security=0. This branch stores `24` and `0`, so
`getSystemVmTemplateVersion()` produces `24.0`; the metadata/template and
`minreq.sysvmtemplate.version` contract is three components, and
`NetworkHelperImpl` later passes this value to `CloudStackVersion.parse`, which
rejects `24.0`. Keep the major/minor together and use the security component as
the tiny component so the configured value remains `24.0.0`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]