Improve python-tools-install.sh alpine compat
[releng/global-jjb.git] / shell / openstack-protect-in-use-images.sh
index fe0bc0f..a422cd8 100644 (file)
@@ -27,10 +27,10 @@ images+=("$(grep -r IMAGE_NAME --include \*.cfg jenkins-config \
 set +o pipefail  # Not all projects have images in YAML files and grep returns non-zero on 0 results
 # Ignore SC2179 since we do not want () to result in an empty array item.
 #shellcheck disable=SC2179
-images+="$(grep -r 'ZZCI - ' --include \*.yaml jjb \
-    | awk -F": " '{print $3}' | sed "s:'::;s:'$::;/^$/d" | sort -u)"
+images+=("$(grep -r 'ZZCI - ' --include \*.yaml jjb \
+    | awk -F": " '{print $3}' | sed -e "s:'::;s:'$::;/^$/d" -e 's/^"//' -e 's/"$//' | sort -u)")
 set -o pipefail
-readarray -t images <<< "$(for i in "${images[@]}"; do echo "$i"; done | sort)"
+readarray -t images <<< "$(for i in "${images[@]}"; do echo "$i"; done | sort -u)"
 
 for image in "${images[@]}"; do
     os_image_protected=$(openstack --os-cloud "$os_cloud" \