From 12e77bc67315b542c102e4243f19fe5553812aba Mon Sep 17 00:00:00 2001 From: Jess Frazelle Date: Fri, 28 Dec 2018 19:40:53 -0500 Subject: [PATCH] fix shellcheck Signed-off-by: Jess Frazelle --- clean-registry/clean-registry | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/clean-registry/clean-registry b/clean-registry/clean-registry index 26b44fe..7b9884a 100755 --- a/clean-registry/clean-registry +++ b/clean-registry/clean-registry @@ -46,15 +46,15 @@ for repo in "${repos[@]}"; do # continue the loop since we cannot cat continue fi - manifest_media_type=$(echo ${manifest} | jq -r '.mediaType') + manifest_media_type=$(echo "${manifest}" | jq -r '.mediaType') echo "media-type: $manifest_media_type" if [ "${manifest_media_type}" == "application/vnd.docker.distribution.manifest.list.v2+json" ] ; then # we have a manifest list and fetch the referenced manifests - additional_manifests=( $(echo ${manifest} | jq -r '.["manifests"] | .[].digest' | cut -d: -f2) ) + mapfile -t additional_manifests < <(echo "${manifest}" | jq -r '.["manifests"] | .[].digest' | cut -d: -f2) - echo "additional_manifests: ${additional_manifests[@]}" + echo "additional_manifests: ${additional_manifests[*]}" fi echo "repo: $repo | tag: $tag | current: ${ha}:${id}" @@ -67,7 +67,7 @@ for repo in "${repos[@]}"; do # shellcheck disable=SC2199 if [[ "${shas[@]}" != "" ]] && [[ ! -z "${shas[@]}" ]]; then - echo "[to be removed]: ${shas[@]}" + echo "[to be removed]: ${shas[*]}" #parallel -j"${JOBS}" reg rm "${REPO_URL}/${repo}@${ha}:{1}" ::: "${shas[@]}" || true fi done