From 07d9fbd1c27ec993a9be1621e372640f6ca55bb5 Mon Sep 17 00:00:00 2001 From: Andrew Grimberg Date: Mon, 18 Nov 2019 09:47:44 -0800 Subject: [PATCH] Fix OS_CLOUD export for image validation Change fe2beb15bc9effb5b91ba17b520ab6c167dd6604 introduced a bug where the CLOUD_CREDENTIAL_ID was being used for the OS_CLOUD export variable. This was done since the test for multi-cloud image validation had the credential IDs matching the OS_CLOUD variable. However, most of our systems have the CLOUD_CREDENTIAL_ID set to the default of 'os-cloud' and therefore after pulling updating to a global-jjb with that change would no longer be able to validate images! We now look for an OS_CLOUD variable in the cloud.cfg file and use it if it is set, otherwise we default to an OS_CLOUD of 'vex' as we previously did before change fe2beb15bc9effb5b91ba17b520ab6c167dd6604 Change-Id: I0af763495fa3a7ce2e8c080324abaf5d384e5188 Signed-off-by: Andrew Grimberg (cherry picked from commit 93a86e0271fa5fd4d1280007289e842edc558653) --- releasenotes/notes/fix-multi-cloud-validator-dedb41f09bb82a81.yaml | 6 ++++++ shell/jenkins-verify-images.sh | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/fix-multi-cloud-validator-dedb41f09bb82a81.yaml diff --git a/releasenotes/notes/fix-multi-cloud-validator-dedb41f09bb82a81.yaml b/releasenotes/notes/fix-multi-cloud-validator-dedb41f09bb82a81.yaml new file mode 100644 index 00000000..cfca7ba9 --- /dev/null +++ b/releasenotes/notes/fix-multi-cloud-validator-dedb41f09bb82a81.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + Change multi-cloud image validation to look for an OS_CLOUD variable in the + cloud.cfg instead of overloading CLOUD_CREDENTIAL_ID as that variable + does not usually point to an ID that is in the openstack clouds.yaml file. diff --git a/shell/jenkins-verify-images.sh b/shell/jenkins-verify-images.sh index f05e3c35..e4e9e708 100755 --- a/shell/jenkins-verify-images.sh +++ b/shell/jenkins-verify-images.sh @@ -44,7 +44,8 @@ for cloud in jenkins-config/clouds/openstack/*; do # Verify that we have a cloud config file if [ -f "$cloud/cloud.cfg" ]; then # Get the OS_CLOUD variable from cloud config and export it - OS_CLOUD=$(grep ^CLOUD_CREDENTIAL_ID= "$cloud/cloud.cfg" | cut -d'=' -f2) + os_cloud=$(grep ^OS_CLOUD= "$cloud/cloud.cfg" | cut -d'=' -f2) + OS_CLOUD="${os_cloud:-vex}" export OS_CLOUD verify_images "$cloud" -- 2.16.6