Skip to content

Commit 8b399d6

Browse files
shwstpprCopilot
andauthored
Update versioning logic in export-templates.sh
Refactor versioning logic to handle four-component metadata separately. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 54b1fe4 commit 8b399d6

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

‎scripts/installer/export-templates.sh‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,13 @@ if [[ "$TEMPLATE_MAJOR_VERSION" -ge "$NEW_VERSIONING_CUTOVER_MAJOR_VERSION" ]];
2929
# New versioning (major.minor.security): the generated template files use the full version as-is.
3030
VERSION="${TEMPLATE_VERSION}"
3131
else
32-
# Legacy versioning (major.minor.patch.security): the generated template files drop the trailing
33-
# security component.
34-
VERSION="${TEMPLATE_VERSION%.*}"
35-
fi
32+
# Legacy versioning drops the trailing security component only for four-component metadata;
33+
# a valid three-component major.minor.patch value is already the filename version.
34+
if [[ "$TEMPLATE_VERSION" == *.*.*.* ]]; then
35+
VERSION="${TEMPLATE_VERSION%.*}"
36+
else
37+
VERSION="${TEMPLATE_VERSION}"
38+
fi
3639
PREFIX=${4:-"systemvmtemplate-$VERSION"}
3740
CLEANUP=${2:-1}
3841
TEMP_IMAGE_PATH="/tmp/sysvm_convert/"

0 commit comments

Comments
 (0)