Skip to content

allow oras command to skip referrer index clean up #954

@qweeah

Description

@qweeah

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:

  • By default, --gc is not set, dangling referrers index will not be clean
  • If --gc is set, clean dangling referrers index when needed

This flag should be added to below commands

  • oras attach
  • oras cp
  • oras manifest push
  • oras manifest delete

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 artifact a. When adding or removing referrers for a, content of i will be updated and a new referrers index will be created and retagged following the tag schema. The index i contains obsolete content without any tag referenced.

When running commands like oras attach and oras 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?

  • Yes, I am willing to implement it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions