From 3a6454ffa8a3e1d57f7daedc060fff3c4ff8814b Mon Sep 17 00:00:00 2001 From: Nick Boldt Date: Tue, 31 Mar 2020 02:11:27 -0400 Subject: [PATCH] CRW-579 don't include dupe entries; if not quiet, echo contents of digests-mapping.txt; add --tls-verify=false when doing skopeo inspect (#213) Change-Id: I4599c0929e13db76b19750066cd6aedc3ea8eb3b Signed-off-by: nickboldt --- olm/addDigests.sh | 15 +++++++-------- olm/buildDigestMap.sh | 2 +- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/olm/addDigests.sh b/olm/addDigests.sh index 9ecee7ed6..2c7a336d5 100755 --- a/olm/addDigests.sh +++ b/olm/addDigests.sh @@ -57,6 +57,7 @@ ${SCRIPTS_DIR}/buildDigestMap.sh -w ${BASE_DIR} -c ${CSV_FILE} -v ${VERSION} ${Q names=" " count=1 RELATED_IMAGES='. * { spec : { relatedImages: [ ' +if [[ ! "${QUIET}" ]]; then cat ${BASE_DIR}/generated/digests-mapping.txt; fi for mapping in $(cat ${BASE_DIR}/generated/digests-mapping.txt) do source=$(echo "${mapping}" | sed -e 's/\(.*\)=.*/\1/') @@ -64,15 +65,13 @@ do sed -i -e "s;${source};${dest};" ${CSV_FILE} name=$(echo "${dest}" | sed -e 's;.*/\([^\/][^\/]*\)@.*;\1;') nameWithSpaces=" ${name} " - if [[ "${names}" == *${nameWithSpaces}* ]]; then - name="${name}-${count}" - count=$(($count+1)) + if [[ "${names}" != *${nameWithSpaces}* ]]; then + if [ "${names}" != " " ]; then + RELATED_IMAGES="${RELATED_IMAGES}," + fi + RELATED_IMAGES="${RELATED_IMAGES} { name: \"${name}\", image: \"${dest}\", tag: \"${source}\"}" + names="${names} ${name} " fi - if [ "${names}" != " " ]; then - RELATED_IMAGES="${RELATED_IMAGES}," - fi - RELATED_IMAGES="${RELATED_IMAGES} { name: \"${name}\", image: \"${dest}\", tag: \"${source}\"}" - names="${names} ${name} " done RELATED_IMAGES="${RELATED_IMAGES} ] } }" mv ${CSV_FILE} ${CSV_FILE}.old diff --git a/olm/buildDigestMap.sh b/olm/buildDigestMap.sh index 58f3fcf50..66469010c 100755 --- a/olm/buildDigestMap.sh +++ b/olm/buildDigestMap.sh @@ -72,7 +72,7 @@ for image in ${OPERATOR_IMAGE} ${IMAGE_LIST} ${REGISTRY_IMAGES_ALL}; do *@) continue;; *) - digest="$(skopeo inspect docker://${image} 2>/dev/null | jq -r '.Digest')" + digest="$(skopeo inspect --tls-verify=false docker://${image} 2>/dev/null | jq -r '.Digest')" if [[ ${digest} ]]; then if [[ ! "${QUIET}" ]]; then echo -n "[INFO] Got digest"; fi echo " $digest # ${image}"