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 manifest delete failed to delete last referrers in registry without referrer API support #1112

Closed
1 task
qweeah opened this issue Sep 11, 2023 · 2 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@qweeah
Copy link
Contributor

qweeah commented Sep 11, 2023

What happened in your environment?

Tried to delete the only referrer of an artifact in OCI-1.0 compliant registry without referrers API support but failed.

What did you expect to happen?

The referrer should be able to be deleted from the referrers index.

How can we reproduce it?

# 1. localhost:6000 is an OCI 1.0 compliant registry
oras discover localhost:6000/test:foobar -o tree
localhost:6000/test@sha256:fd6ed2f36b5465244d5dc86cb4e7df0ab8a9d24adc57825099f522fe009a22bb
└── test/sbom.file
    └── sha256:e2c6633a79985906f1ed55c592718c73c41e809fb9818de232a635904a74d48d
        └── test/signature.file
            └── sha256:0cb8c4da7e9ff2e7eefca33141091b9239218e3125a35e17e8bcd05fa3a5e714

# 2. delete referrers sha256:e2c6633a79985906f1ed55c592718c73c41e809fb9818de232a635904a74d48d
✗ oras manifest delete -v localhost:6000/test@sha256:e2c6633a79985906f1ed55c592718c73c41e809fb9818de232a635904a74d48d
Are you sure you want to delete the manifest "sha256:e2c6633a79985906f1ed55c592718c73c41e809fb9818de232a635904a74d48d" and all tags associated with it? [y/N] y
Deleted localhost:6000/test@sha256:e2c6633a79985906f1ed55c592718c73c41e809fb9818de232a635904a74d48d

# 3. manifest doesn't exist any more
✗ oras manifest fetch localhost:6000/test@sha256:e2c6633a79985906f1ed55c592718c73c41e809fb9818de232a635904a74d48d
Error: failed to fetch the content of "localhost:6000/test@sha256:e2c6633a79985906f1ed55c592718c73c41e809fb9818de232a635904a74d48d": localhost:6000/test@sha256:e2c6633a79985906f1ed55c592718c73c41e809fb9818de232a635904a74d48d: not found

# 4. but tag of sha256-fd6ed2f36b5465244d5dc86cb4e7df0ab8a9d24adc57825099f522fe009a22bb still returns the deleted referrer
oras discover localhost:6000/test:foobar -o tree
localhost:6000/test@sha256:fd6ed2f36b5465244d5dc86cb4e7df0ab8a9d24adc57825099f522fe009a22bb
└── test/sbom.file
    └── sha256:e2c6633a79985906f1ed55c592718c73c41e809fb9818de232a635904a74d48d
        └── test/signature.file
            └── sha256:0cb8c4da7e9ff2e7eefca33141091b9239218e3125a35e17e8bcd05fa3a5e714

What is the version of your ORAS CLI?

1.1.0

What is your OS environment?

Ubuntu 20.04

Are you willing to submit PRs to fix it?

  • Yes, I am willing to fix it.
@qweeah qweeah added the bug Something isn't working label Sep 11, 2023
@qweeah qweeah added this to the v1.2.0 milestone Sep 11, 2023
@qweeah
Copy link
Contributor Author

qweeah commented Sep 11, 2023

This relies on the fix of oras-project/oras-go#592

@qweeah
Copy link
Contributor Author

qweeah commented Dec 26, 2023

Resolved by #1154

@qweeah qweeah closed this as completed Dec 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant