summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Wienand <iwienand@redhat.com>2021-11-04 10:04:58 +1100
committerIan Wienand <iwienand@redhat.com>2021-11-04 01:36:11 +0000
commitc062de4f24f1c29d8e7c7bb031a9c9672a183fc9 (patch)
treede63e08c0f5844b65fdb502f4b920a6e4d530ed2
parentf52feef699449053b64f76bb05e542b87fd3087c (diff)
downloadheat-c062de4f24f1c29d8e7c7bb031a9c9672a183fc9.tar.gz
Fallback to upstream for Fedora image
OpenDev infra only keep around the latest two Fedora releases in their mirrors. Probe for the image from the local test mirror, but if not found, fallback to upstream. This will be much less reliable, but can avoid gate breakage until new images can be used. Depends-On: https://review.opendev.org/c/openstack/heat/+/816603 Cherry-Picked-From: f7574531d3dc3bbbf55fd7c17d55a10b5320c5ff Change-Id: I96ab14871ee8c5d5b83cc0cd4abc840ef0218ca8
-rw-r--r--devstack/lib/heat11
1 files changed, 10 insertions, 1 deletions
diff --git a/devstack/lib/heat b/devstack/lib/heat
index ee04a1fdd..c237d9610 100644
--- a/devstack/lib/heat
+++ b/devstack/lib/heat
@@ -475,10 +475,19 @@ function configure_tempest_for_heat {
source $TOP_DIR/openrc admin admin
iniset $TEMPEST_CONFIG heat_plugin admin_username $OS_USERNAME
iniset $TEMPEST_CONFIG heat_plugin admin_password $OS_PASSWORD
+
+ # NOTE(ianw) OpenDev infra only keeps the latest two Fedora's
+ # around; prefer the mirror but allow fallback
if [[ -e /etc/ci/mirror_info.sh ]]; then
source /etc/ci/mirror_info.sh
fi
- export HEAT_TEST_FEDORA_IMAGE=${NODEPOOL_FEDORA_MIRROR:-https://download.fedoraproject.org/pub/fedora/linux}/releases/33/Cloud/x86_64/images/Fedora-Cloud-Base-33-1.2.x86_64.qcow2
+ HEAT_TEST_FEDORA_IMAGE_UPSTREAM=https://download.fedoraproject.org/pub/fedora/linux
+ HEAT_TEST_FEDORA_IMAGE_PATH=releases/33/Cloud/x86_64/images/Fedora-Cloud-Base-33-1.2.x86_64.qcow2
+ if curl --output /dev/null --silent --head --fail "${NODEPOOL_FEDORA_MIRROR}/${HEAT_TEST_FEDORA_IMAGE_PATH}"; then
+ export HEAT_TEST_FEDORA_IMAGE="${NODEPOOL_FEDORA_MIRROR}/${HEAT_TEST_FEDORA_IMAGE_PATH}"
+ else
+ export HEAT_TEST_FEDORA_IMAGE="${HEAT_TEST_FEDORA_IMAGE_UPSTREAM}/${HEAT_TEST_FEDORA_IMAGE_PATH}"
+ fi
TOKEN=$(openstack token issue -c id -f value)
local image_exists=$( openstack image list | grep "Fedora-Cloud-Base-33-1.2.x86_64" )
if [[ -z $image_exists ]]; then