summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2019-02-26 09:31:47 +0000
committerMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2019-02-26 10:01:08 +0000
commit90935acc02c6219a06613ae6a0c85a65f8566acc (patch)
tree593b865c7ba6722975f169c58fa8b113eb7a8bcc
parentbdbd1f2c3aa71e2217cb85fdae4d3cde42a2f303 (diff)
tcwg-cleanup-stale-containers.sh: Fix volume cleanup
"Echo" concatenates all elements into a single string, so we need to break them up for "grep" to match its pattern. Change-Id: I954ca80fc6f0e289185780f76988688ce0f1ed78
-rwxr-xr-xtcwg-cleanup-stale-containers.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/tcwg-cleanup-stale-containers.sh b/tcwg-cleanup-stale-containers.sh
index 86fc04b8..0dd642f7 100755
--- a/tcwg-cleanup-stale-containers.sh
+++ b/tcwg-cleanup-stale-containers.sh
@@ -148,7 +148,7 @@ status=$(($status|(2*$res)))
rm_volumes=($($DOCKER volume ls -q -f dangling=true))
# Filter-out named volumes like host-home and home-$USER. Leave only volumes
# named like a sha1 hash.
-rm_volumes=($(echo "${rm_volumes[@]}" | grep "^[a-f0-9]\{64\}\$" | cat))
+rm_volumes=($(echo "${rm_volumes[@]}" | tr " " "\n" | grep "^[a-f0-9]\{64\}\$" | cat))
if [ ${#rm_volumes[@]} != 0 ]; then
echo "Removing dangling volumes"