Skip to content

Transfer: Push: fix failure on pushing duplicated blobs#10287

Merged
mxpv merged 1 commit intocontainerd:mainfrom
ktock:transfer-push-dup
Jun 4, 2024
Merged

Transfer: Push: fix failure on pushing duplicated blobs#10287
mxpv merged 1 commit intocontainerd:mainfrom
ktock:transfer-push-dup

Conversation

@ktock
Copy link
Copy Markdown
Member

@ktock ktock commented May 31, 2024

Currently transfer service doesn't handle conflict among pushing of duplicated blobs and pushing an image with duplicated blobs fails.

This commit fixes this issue by using dockerPusher.Writer that detects the conflict and allow retrying using content.OpenWriter helper. content.OpenWriter is already used by remotes.PushHandler to handle duplicated blobs safely.
But transfer service doesn't use this so it (and ctr i push) fails to push duplicated blobs.

This commit fixes this issue.

Reproduce

Pushing of gcr.io/k8s-staging-cri-tools/test-image-tags:1 (contains duplicated manifests, as of now) to another registry fails without this patch. (Detected at stargz-snapshotter CI: https://github.com/containerd/stargz-snapshotter/actions/runs/9303215973/job/25605036366?pr=1545#step:4:10911 )

ctr i pull --all-platforms gcr.io/k8s-staging-cri-tools/test-image-tags:1
ctr i tag gcr.io/k8s-staging-cri-tools/test-image-tags:1 registry2:5000/test-image-tags:1
ctr i push --plain-http registry2:5000/test-image-tags:1

@dmcgowan dmcgowan added this pull request to the merge queue Jun 3, 2024
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 3, 2024
@mxpv mxpv added this pull request to the merge queue Jun 4, 2024
Merged via the queue into containerd:main with commit 1369112 Jun 4, 2024
@ktock ktock deleted the transfer-push-dup branch June 4, 2024 01:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants