File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616# specific language governing permissions and limitations
1717# under the License.
1818
19+ NEW_VERSIONING_CUTOVER_MAJOR_VERSION=24
20+
1921METADATA_FILE=" metadata.ini"
2022IMAGE_PATH=${3:- " /usr/share/cloudstack-management/templates/systemvm/" }
2123TEMPLATE_VERSION=$( awk -F " =" ' /version/ {print $2}' ${IMAGE_PATH}${METADATA_FILE} | xargs)
2224TEMPLATE_PATH=" /usr/share/cloudstack-management/templates/systemvm/"
23- VERSION=" ${TEMPLATE_VERSION% .* } "
25+ TEMPLATE_MAJOR_VERSION=" $( cut -d' .' -f1 <<< " $TEMPLATE_VERSION" ) "
26+ if [[ " $TEMPLATE_MAJOR_VERSION " -ge " $NEW_VERSIONING_CUTOVER_MAJOR_VERSION " ]]; then
27+ # New versioning (major.minor.security): the generated template files use the full version as-is.
28+ VERSION=" ${TEMPLATE_VERSION} "
29+ else
30+ # Legacy versioning (major.minor.patch.security): the generated template files drop the trailing
31+ # security component.
32+ VERSION=" ${TEMPLATE_VERSION% .* } "
33+ fi
2434PREFIX=${4:- " systemvmtemplate-$VERSION " }
2535CLEANUP=${2:- 1}
2636TEMP_IMAGE_PATH=" /tmp/sysvm_convert/"
You can’t perform that action at this time.
0 commit comments