oras-project / oras

OCI registry client - managing content like artifacts, images, packages
https://oras.land
Apache License 2.0
1.33k stars 160 forks source link

`oras tag` should not create referrers tags #1436

Open qweeah opened 2 days ago

qweeah commented 2 days ago

Although tagging a referrer artifact manifest is discouraged, it is still doable. However, re-tagging is implemented as pushing the exact manifest again to the remote server. According to the distribution-spec, if the remote server does not support referrers API, it will go for the referrers tag schema case. However, it is not necessary since the manifest is already there, we are just adding a new tag not really pushing a new manifest.

In summary, tagging a referrers manifest should never go for the tag schema even if the server does not support referrers API since the referrer manifest is already there on the server.

Originally posted by @shizhMSFT in https://github.com/oras-project/oras/issues/1435#issuecomment-2197136662

qweeah commented 10 hours ago

BTW this bug generates unwanted referrer tags (256-xxx) ONLY in registries that haven't implemented OCI Distribution Spec v1.1.0.