Skip to content

Commit b1c32cb

Browse files
committed
Add --retry-times to a skopeo commands
Sometimes a registry returns an invalid code that causes a whole pipeline to fail. Adding this flag should fix majority of these temporary failures. JIRA: ISV-4789 Signed-off-by: Ales Raszka <[email protected]>
1 parent a04a207 commit b1c32cb

File tree

9 files changed

+15
-3
lines changed

9 files changed

+15
-3
lines changed

ansible/roles/index_signature_verification/files/tasks/verify-index-signatures.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ spec:
7373
for image in $(cat image-tags.txt); do
7474
dest=$(echo -n $image | base64)
7575
echo "Inspecting $image"
76-
skopeo inspect --raw docker://$image > $dest.json
76+
skopeo inspect --retry-times 5 --raw docker://$image > $dest.json
7777
done
7878
7979
- name: get-digest-pull-specs

ansible/roles/operator-pipeline/templates/openshift/tasks/copy-image.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,19 +58,21 @@ spec:
5858
CONNECT_REPO_PATH="$(params.connect_registry)/$(params.vendor_label)/$(params.repo_name)"
5959
6060
skopeo copy \
61+
--retry-times 5 \
6162
--src-authfile $SRC_AUTHFILE \
6263
--dest-authfile $DEST_AUTHFILE \
6364
docker://$(params.src_image) \
6465
docker://"$(params.dest_image_registry_namespace_certproject):$(params.dest_image_tag)"
6566
6667
6768
skopeo copy \
69+
--retry-times 5 \
6870
--src-authfile $SRC_AUTHFILE \
6971
--dest-authfile $DEST_AUTHFILE \
7072
docker://$(params.src_image) \
7173
docker://"$(params.dest_image_registry_namespace_certproject):latest"
7274
73-
DIGEST=$(skopeo inspect --authfile $DEST_AUTHFILE docker://$(params.dest_image_registry_namespace_certproject):$(params.dest_image_tag) | jq -r .Digest)
75+
DIGEST=$(skopeo inspect --retry-times 5 --authfile $DEST_AUTHFILE docker://$(params.dest_image_registry_namespace_certproject):$(params.dest_image_tag) | jq -r .Digest)
7476
echo -n $DIGEST | tee $(results.container_digest.path)
7577
echo "- $CONNECT_REPO_PATH:$(params.dest_image_tag)" | tee "$RELEASE_INFO_DIR_PATH/released_bundle.txt"
7678
echo -n "$CONNECT_REPO_PATH@${DIGEST}" > $(results.image_pullspec.path)

ansible/roles/operator-pipeline/templates/openshift/tasks/get-manifest-digests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ spec:
4646
4747
DIGEST=$(echo $i | awk -F '+' '{print $2}')
4848
49-
MANIFEST_LIST=$(skopeo inspect --raw docker://$DIGEST)
49+
MANIFEST_LIST=$(skopeo inspect --retry-times 5 --raw docker://$DIGEST)
5050
MANIFEST_LIST=$(echo $MANIFEST_LIST | jq -r '.manifests[].digest')
5151
5252
# create comma separated index images that match each digest

ansible/roles/operator-pipeline/templates/openshift/tasks/publish-pyxis-data.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ spec:
7777
IMAGE_PULL_SPEC="$(params.internal_registry)/$(params.internal_repository)@$(params.container_digest)"
7878
7979
skopeo inspect \
80+
--retry-times 5 \
8081
--no-tags \
8182
--authfile $(workspaces.registry-credentials.path)/.dockerconfigjson \
8283
docker://$IMAGE_PULL_SPEC > $(workspaces.image-data.path)/skopeo-inspect.json

ansible/roles/operator-pipeline/templates/openshift/tasks/publish-to-index.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ spec:
122122
# Add version tag to an index
123123
skopeo \
124124
--command-timeout 300s copy \
125+
--retry-times 5 \
125126
--format v2s2 --all \
126127
--src-no-creds \
127128
--dest-creds $QUAY_USER:$QUAY_TOKEN \
@@ -131,6 +132,7 @@ spec:
131132
# Add permanent tag to an index
132133
skopeo \
133134
--command-timeout 300s copy \
135+
--retry-times 5 \
134136
--format v2s2 --all \
135137
--src-no-creds \
136138
--dest-creds $QUAY_USER:$QUAY_TOKEN \

ansible/roles/operator-pipeline/templates/openshift/tasks/tag-image.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ spec:
2828
2929
for tag in "${TAGS[@]}" ; do
3030
skopeo copy \
31+
--retry-times 5 \
3132
--authfile "${AUTHFILE}" \
3233
"docker://${REF}" \
3334
"docker://${UNTAGGED_REF}:${tag}"

operator-pipeline-images/operatorcert/utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,8 @@ def copy_images_to_destination(
216216
cmd = [
217217
"skopeo",
218218
"copy",
219+
"--retry-times",
220+
"5",
219221
f"docker://{response.get('index_image_resolved')}",
220222
f"docker://{destination}:{version}{tag_suffix}",
221223
]

operator-pipeline-images/tests/test_utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,8 @@ def test_copy_images_to_destination(mock_subprocess: MagicMock) -> None:
160160
[
161161
"skopeo",
162162
"copy",
163+
"--retry-times",
164+
"5",
163165
"docker://quay.io/qwe/asd@sha256:1234",
164166
"docker://quay.io/foo/bar:v4.12-foo",
165167
"--authfile",

scripts/community-quay-migration.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,8 @@ def copy_tag(
278278
cmd = [
279279
"skopeo",
280280
"copy",
281+
"--retry-times",
282+
"5",
281283
f"docker://{QUAY_HOST}/{src_namespace}/{src_repo}:{src_tag}",
282284
f"docker://{QUAY_HOST}/{dest_namespace}/{dest_repo}:{dest_tag}",
283285
"--all",

0 commit comments

Comments
 (0)