From ca83a4c3cbee19a98d8a7994c34c29a4d5cc0659 Mon Sep 17 00:00:00 2001 From: Maksim Malchuk Date: Fri, 22 Jan 2021 16:33:02 +0300 Subject: [PATCH] Don't use hardcode while override base image file The trvial fix allow override to work in air-gapped envirments where the command 'curl -s https://cloud.centos.org/...' would fail. Change-Id: I84296d8816042e4cd4cb02f15746b86d600d13d6 Signed-off-by: Maksim Malchuk --- diskimage_builder/elements/centos/root.d/10-centos-cloud-image | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/diskimage_builder/elements/centos/root.d/10-centos-cloud-image b/diskimage_builder/elements/centos/root.d/10-centos-cloud-image index cca99257..29c6ba78 100755 --- a/diskimage_builder/elements/centos/root.d/10-centos-cloud-image +++ b/diskimage_builder/elements/centos/root.d/10-centos-cloud-image @@ -51,8 +51,7 @@ else if [[ "${DIB_RELEASE}" = 7 ]]; then BASE_IMAGE_FILE=${BASE_IMAGE_FILE:-CentOS-${DIB_RELEASE}-${ARCH}-${DIB_FLAVOR}.qcow2.xz} else - LATEST_IMAGE_FILE=$(curl -s https://cloud.centos.org/centos/${DIB_RELEASE}/${ARCH}/images/ | grep -o "CentOS-.[^>]*${DIB_FLAVOR}-.[^>]*.qcow2" | sort -r | head -1) - BASE_IMAGE_FILE=${BASE_IMAGE_FILE:-$LATEST_IMAGE_FILE} + BASE_IMAGE_FILE=${BASE_IMAGE_FILE:-$(curl -s https://cloud.centos.org/centos/${DIB_RELEASE}/${ARCH}/images/ | grep -o "CentOS-.[^>]*${DIB_FLAVOR}-.[^>]*.qcow2" | sort -r | head -1)} fi BASE_IMAGE_TAR=$BASE_IMAGE_FILE.tgz IMAGE_LOCATION=$DIB_CLOUD_IMAGES/$BASE_IMAGE_FILE