Skip to content

Commit ef35339

Browse files
Merge pull request #1546 from openshift-cherrypick-robot/cherry-pick-1544-to-18.0-fr3
[18.0-fr3] [bindata] catch skopeo copy failures
2 parents d473197 + 7c9e54e commit ef35339

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

hack/sync-bindata.sh

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -142,13 +142,21 @@ EOF_CAT
142142
}
143143

144144
for BUNDLE in $(hack/pin-bundle-images.sh | tr "," " "); do
145-
n=0
146-
until [ "$n" -ge 5 ]; do
147-
skopeo copy "docker://$BUNDLE" dir:${EXTRACT_DIR}/tmp && break
148-
echo "Command failed. retrying ... $n/5"
149-
n=$((n+1))
150-
sleep 15
151-
done
145+
(
146+
set +e
147+
n=0
148+
RC=1
149+
while :; do
150+
skopeo copy "docker://$BUNDLE" dir:${EXTRACT_DIR}/tmp
151+
RC=$?
152+
if [ $RC -eq 0 -o "$n" -ge 5 ]; then
153+
exit $RC
154+
fi
155+
n=$((n+1))
156+
echo "Command failed. retrying ... $n/5"
157+
sleep 15
158+
done
159+
)
152160
extract_bundle "${EXTRACT_DIR}/tmp" "${OUT_DATA}/"
153161
done
154162

0 commit comments

Comments
 (0)