summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-09-03 06:04:08 -0700
committerGitHub <noreply@github.com>2019-09-03 06:04:08 -0700
commitc03949986feffd489e6fd41538d6a5bda233e850 (patch)
treeb64db8aec68c015a290cce2ca059af52692d55dc /contrib
parent7e238b9e0c650b20f1a325dad14ef94a3e7d1aab (diff)
parent56f11b1016f90d73421fa71ee8a726d2d83c9349 (diff)
downloadpodman-c03949986feffd489e6fd41538d6a5bda233e850.tar.gz
podman-c03949986feffd489e6fd41538d6a5bda233e850.tar.bz2
podman-c03949986feffd489e6fd41538d6a5bda233e850.zip
Merge pull request #3904 from cevich/fix_img_prune
Cirrus: imgprune fixes
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/imgprune/entrypoint.sh14
1 files changed, 9 insertions, 5 deletions
diff --git a/contrib/imgprune/entrypoint.sh b/contrib/imgprune/entrypoint.sh
index 829e9938e..b0f006332 100755
--- a/contrib/imgprune/entrypoint.sh
+++ b/contrib/imgprune/entrypoint.sh
@@ -6,13 +6,17 @@ source /usr/local/bin/lib_entrypoint.sh
req_env_var GCPJSON GCPNAME GCPPROJECT IMGNAMES
-BASE_IMAGES=""
-# When executing under Cirrus-CI, have access to current source
-if [[ "$CI" == "true" ]] && [[ -r "$CIRRUS_WORKING_DIR/$SCRIPT_BASE" ]]
+unset BASE_IMAGES
+# When executing under Cirrus-CI, script have access to current source
+LIB="$CIRRUS_WORKING_DIR/$SCRIPT_BASE/lib.sh"
+if [[ "$CI" == "true" ]] && [[ -r "$LIB" ]]
then
# Avoid importing anything that might conflict
- eval "$(egrep -sh '^export .+BASE_IMAGE=' < $CIRRUS_WORKING_DIR/$SCRIPT_BASE/lib.sh)"
- BASE_IMAGES="$UBUNTU_BASE_IMAGE $PRIOR_UBUNTU_BASE_IMAGE $FEDORA_BASE_IMAGE $PRIOR_FEDORA_BASE_IMAGE"
+ for env in $(sed -ne 's/^[^#]\+_BASE_IMAGE=/img=/p' "$LIB")
+ do
+ eval $env
+ BASE_IMAGES="$BASE_IMAGES $img"
+ done
else
# metadata labeling may have broken for some reason in the future
echo "Warning: Running outside of Cirrus-CI, very minor-risk of base-image deletion."