From: Kienan Stewart Date: Tue, 30 Jan 2024 16:48:42 +0000 (-0500) Subject: jjb: Use image type to different vm and container distrobuild images X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=2b68ab06e47e324d5212925bc5055b6c9627e9ee;p=lttng-ci.git jjb: Use image type to different vm and container distrobuild images 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 --- diff --git a/pipelines/images/distrobuild.sh b/pipelines/images/distrobuild.sh index 7c2e161..a4e6a6c 100644 --- a/pipelines/images/distrobuild.sh +++ b/pipelines/images/distrobuild.sh @@ -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 diff --git a/pipelines/images/imagebuild.sh b/pipelines/images/imagebuild.sh index 340f71c..ecc192d 100644 --- a/pipelines/images/imagebuild.sh +++ b/pipelines/images/imagebuild.sh @@ -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))