Digests:
docker run -dp 5000:5000 registry
# oras copy
oras cp jinzha1.azurecr.io/demo/dangling-referrers-index:A localhost:5000/test:A --concurrency 1 -v
# oras manifest push
echo '{"schemaVersion":2,"mediaType":"application/vnd.oci.image.manifest.v1+json","config":{"mediaType":"test","digest":"sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a","size":2},"layers":[],"subject":{"mediaType":"application/vnd.oci.image.manifest.v1+json","digest":"sha256:dc0ea9814a627d14791bc9d487629249f0a92bf7c9554652dc933c56c3fe31a1","size":517},"annotations":{"org.opencontainers.image.created":"2023-05-18T02:40:53Z","test1":"true"}}' | oras manifest push localhost:5000/test -
# oras attach
oras attach localhost:5000/test@sha256:dc0ea9814a627d14791bc9d487629249f0a92bf7c9554652dc933c56c3fe31a1 -a test=true --artifact-type test
# oras manifest delete
oras discover localhost:5000/test@sha256:dc0ea9814a627d14791bc9d487629249f0a92bf7c9554652dc933c56c3fe31a1
oras manifest delete localhost:5000/test@sha256:3c83b2cc2486e05ef0dcc860d184aca400023d2f3bc5c16a66f12e9252b943cf -f
if the return error indicates deleting a dangling referrers index, should be ignored
functions sending more than one HTTP(s) request should not stop on such error
option 1: add a new option to repository, allow skipping dangling referrers deletion
pros: easy to implement
cons: user don't know which referrers are dangling, cannot do GC
need investigate whether and how user uses untagged(undisoverable) manifest
Ideal implementation:
--gc
set to true, can be set to false
(2.0 should be default to false)distribution spec doesn't mandate the GC
option 2: add a new option to repository, ignore delete dangling referrers error on oras-go side
option 3: aggregate delete dangling referrers errors into one error and return
show detail of operation