Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Jun 4, 2024

Conversation

ktock
Copy link
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

Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
@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
42 checks passed
@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.

None yet

5 participants