jjb: Use image type to different vm and container distrobuild images
authorKienan Stewart <kstewart@efficios.com>
Tue, 30 Jan 2024 16:48:42 +0000 (11:48 -0500)
committerKienan Stewart <kstewart@efficios.com>
Fri, 2 Feb 2024 14:07:03 +0000 (09:07 -0500)
Our lxd instance doesn't support applying the same alias to multiple
image fingerprints at this time.

Change-Id: Id12ade8f6ea1c00be10bc33528448f5b0c016f37
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
pipelines/images/distrobuild.sh
pipelines/images/imagebuild.sh

index 7c2e161d841b5d7eb02bcf46a4ed9f4619c3f13f..a4e6a6c30737a8d69e921cb59c8f199bcbd9205c 100644 (file)
@@ -181,6 +181,10 @@ if [[ "${ARCH}" == "i386" ]] ; then
     rm -rf "${TMP_DIR}"
 fi
 
+# When using `lxc image import` two images cannot have the same alias -
+# only the last image imported will keep the alias. Therefore, the
+# image type is appended as part of the alias.
+IMAGE_NAME="${IMAGE_NAME}/${IMAGE_TYPE}"
 lxc image import "${BUILD_DIR}/incus.tar.xz" "${ROOTFS}" --alias="${IMAGE_NAME}" ci:
 
 if [[ "${TEST}" == "true" ]] ; then
index 340f71c744dbc3323fe75e9ce0a39f470f4523f0..ecc192dae06bd0d3c166b2d20c2b8a91c51cabaf 100644 (file)
@@ -91,7 +91,7 @@ set +e
 TRIES_MAX=3
 TRIES=0
 while [[ "${TRIES}" -lt "${TRIES_MAX}" ]] ; do
-    if ! INSTANCE_NAME=$(lxc -q launch -e "${VM_ARG[@]}" -p default -p "${LXD_INSTANCE_PROFILE}" "${SOURCE_IMAGE_NAME}") ; then
+    if ! INSTANCE_NAME=$(lxc -q launch -e "${VM_ARG[@]}" -p default -p "${LXD_INSTANCE_PROFILE}" "${SOURCE_IMAGE_NAME}/${IMAGE_TYPE}") ; then
         # Try from images
         if ! INSTANCE_NAME=$(lxc -q launch -e "${VM_ARG[@]}" -p default -p "${LXD_INSTANCE_PROFILE}" images:"${SOURCE_IMAGE_NAME}") ; then
             TRIES=$((TRIES + 1))
This page took 0.024419 seconds and 4 git commands to generate.