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

oras doesn't push a file with 2 tags #447

Closed
afdesk opened this issue Jul 14, 2022 · 3 comments · Fixed by #452
Closed

oras doesn't push a file with 2 tags #447

afdesk opened this issue Jul 14, 2022 · 3 comments · Fixed by #452

Comments

@afdesk
Copy link

afdesk commented Jul 14, 2022

hi team! thanks for your really useful tool.

there is a problem with the latest version (0.13.0):
oras can't upload a file with 2 tags:

#!/bin/sh
tags=(latest 2)
for tag in ${tags[@]}; do
  oras push ghcr.io/afdesk/db-private:${tag} \
    --manifest-config /dev/null:application/vnd.afdesk.config.v1+json \
    db.tar.gz:application/vnd.afdesk.db.layer.v1.tar+gzip
done

the result:

$ ./up.sh 
Uploading cdbbe2e80b77 db.tar.gz
Exists    e3b0c44298fc 
Pushed ghcr.io/afdesk/db-private:latest
Digest: sha256:3d4023cb394a3d4dd5749be9b68af5a8e4869f4e9515cfc793e636616efc81f2
Exists    3d4023cb394a 
Pushed ghcr.io/afdesk/db-private:2
Digest: sha256:3d4023cb394a3d4dd5749be9b68af5a8e4869f4e9515cfc793e636616efc81f2

but it works correctly for version v0.12.0.

I hope it'll fix. thanks!

@afdesk afdesk changed the title oras doesn't pull a file with 2 tags oras doesn't push a file with 2 tags Jul 14, 2022
@qweeah
Copy link
Contributor

qweeah commented Jul 15, 2022

Thanks @afdesk for reporting this issue, looking at this

@qweeah
Copy link
Contributor

qweeah commented Jul 15, 2022

This should be a bug from oras-project/oras-go. @Wwwsylvia Can you take a look?

Reproduce Step

oras version: 0.13.0

  1. Package an OCI artifact and push
    echo "test" > hi.txt && oras push $REG/$REPO hi.txt
  2. Repush the artifact
    oras push $REG/$REPO:tag hi.txt
  3. Push will be successful on client side but tag won't be created in the registry.

Root Cause

If a manifest blob is found existed (https://github.com/oras-project/oras-go/blob/main/copy.go#L154-L163), the copy process will be skipped as well as the retagging process.

@Wwwsylvia
Copy link
Member

Thanks for reporting the issue! I will look into this next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants