Fix auto update image script to compare image type 05/61905/1
authorAnil Belur <abelur@linuxfoundation.org>
Thu, 3 Oct 2019 11:46:12 +0000 (17:16 +0530)
committerAnil Belur <abelur@linuxfoundation.org>
Thu, 3 Oct 2019 11:46:12 +0000 (17:16 +0530)
Fix auto update image script to compare the image type before
updating an the image in the source repository. This fixes the
bug that updates images although they are the same flavour but
a diffirent type.

Issue: RELENG-2352
Change-Id: Ibaaeea41fb3d8a413e527c56b898a1fecadf5d22
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
releasenotes/notes/fix-image-update-script-a610a99f13f878db.yaml [new file with mode: 0644]
shell/update-cloud-images.sh

diff --git a/releasenotes/notes/fix-image-update-script-a610a99f13f878db.yaml b/releasenotes/notes/fix-image-update-script-a610a99f13f878db.yaml
new file mode 100644 (file)
index 0000000..b814489
--- /dev/null
@@ -0,0 +1,6 @@
+---
+fixes:
+  - |
+    Fix the auto update image script to compare the image type before updating
+    an the image in the source repository. This fixes the bug that updates
+    images although they are the same flavour but a diffirent type.
index 6b39c7c..d3cd18f 100644 (file)
@@ -44,6 +44,9 @@ while read -r line ; do
     # var is unset and update all images on Jenkins to the latest.
     if [[ ${NEW_IMAGE_NAME} != all ]]; then
         new_image=${NEW_IMAGE_NAME}
+        new_image_type="${NEW_IMAGE_NAME% -*}"
+        # get the $new_image_type to check the image type is being compared
+        [[ ${new_image_type} =~ ${image_type} ]] && continue
     else
         new_image=$(openstack image list --long -f value -c Name -c Protected \
             | grep "${image_type}.*False" | tail -n-1 | sed 's/ False//')