-
Notifications
You must be signed in to change notification settings - Fork 181
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
allow oras command to skip referrer index clean up #954
Comments
Let me provide more context about this proposal. As I mentioned in #915 , ORAS CLI attempts to delete the dangling referrers index (outdated referrers index) by default for garbage collection purposes when attaching/pushing/copying an artifact in the OCI v1.0 compliant registry (referrers API is not supported). However, Cleaning up dangling referrers index when pushing content to the OCI v1.0 compliant registry is not defined in OCI Distribution Spec v1.1.0-RC.2. This is not an officially recommended behavior from the OCI Distribution Spec. In fact, most of the OCI registries support garbage collection. Clean up might be out of the scope of a registry client like ORAS. I think ORAS can give the responsibility to users or registry operators instead of helping users clean up those dangling referrers index from the registry automatically. Having a |
linking oras-project/oras-go#510 |
What is the expected behavior of this command if the user has push but not delete rights? |
|
which command are you referring to? Generally, the cmd execution should success if user doesn't enforce referrers GC. |
Trying to avoid tag schema or any other terms that normal user won't be able to understand. How about |
opencontainers/distribution-spec#406 had a discussion about GC. It seems OCI Distribution-spec will not define GC policy and behavior for OCI registries in the short term. |
Also wanted to include the option to consider manually scripting this. Manifest delete of a tagged digest to some extent is like pushing to latest. Can the user script and pipe the output into manifest delete? Is this flag even needed since this is until we have referrers as default and this flag becomes obsolete and a no-op. I not really certain this is necessary since manifest deletes of untagged manifests are handled by registries differently. |
This requires a change in oras-go, to return an aggregate error including all the dangling referrers index nodes that failed to be cleaned. I want to point out that if registry deletion is disabled, the piped command will still fail.
No, but the proposed change is aiming for registries without referrers API. We can keep it in oras v1 which serves as long term support for OCI 1.0 registries and remove it in oras v2. |
Even if we keep the flag scope it so that we don't end up with things like For e.g |
Agree. GC is too generic and we should avoid it. |
|
Had a discussion offline with @FeynmanZhou @yizha1 and @shizhMSFT, want to point out that to avoid breaking change, @shizhMSFT suggested to set
I agree that removing unused referrers index goes beyond the common scope of registry clients, so we will change the default value to |
What is the version of your ORAS CLI
1.0.0
What would you like to be added?
To all oras commands causing referrers update, a new flag
--gc
should be added to skip deleting the dangling referrers index:--gc
is not set, dangling referrers index will not be clean--gc
is set, clean dangling referrers index when neededThis flag should be added to below commands
Why is this needed for ORAS?
Referrer index is the alternative that OCI-1.0 compliant registries can utilize to support artifact reference types, see OCI spec 1.0-rc.2.
If a referrers index
i
exists for a certain subject artifacta
. When adding or removing referrers fora
, content ofi
will be updated and a new referrers index will be created and retagged following the tag schema. The indexi
contains obsolete content without any tag referenced.When running commands like
oras attach
andoras cp
, it's possible that the used token scope doesn't cover delete, or the registry might disable deletion, so it's better to provide oras an option to skip cleaning the dangling referrers index.Also checked OCI spec, cleanup is optional for registry clients.
Are you willing to submit PRs to contribute to this feature?
The text was updated successfully, but these errors were encountered: