oras-project / oras

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

does oras plan to support delete helm charts from docker registry? #171

Closed hustclf closed 2 years ago

hustclf commented 4 years ago

does oras has a plan to support delete helm charts from docker registry?

Thanks.

jdolitsky commented 4 years ago

@hustclf currently no plan. This functionality is supported via the OCI API, but many registries do not support it. What would this look like from a UX perspective?

jzelinskie commented 4 years ago

Deleting via the distribution API is optional to support for registries, so the UX would also suffer from the fact that these operations can (and most commonly will) fail.

hustclf commented 4 years ago

@jdolitsky I have no idea about the UX perspective.

I store helm charts in docker registry via helm registry, and there too many old versions of charts as time going on, I just want to delete these from docker registry, but not found in registry api, is there a solution can solve my problem?

Thanks!

mattfarina commented 4 years ago

@jzelinskie I think you hit on something worth noting in the design. Is ORAS looking to only support required distribution spec features or optional ones as well? If optional ones would be supported than I would suggest supporting the delete operation but gracefully telling the callers when it's not implemented.

SteveLasker commented 4 years ago

As time yields on, developers automate, and we all recognize storage is:

  1. not infinite
  2. not free - someone pays
  3. means I have old stuff that is insecure and causes users & customers compliance issues

We should absolutely support the delete api of the oci distribution spec. While not every registry supports delete, that's a registry option. The ORAS client & library should support needed apis that are standard on the spec.

harishsg99 commented 4 years ago

We need to delete via API and but there is no UX support that as of now!! :)

SteveLasker commented 4 years ago

Are you asking for what the delete api would look like in the ORAS library and ORAS client? The current CLI:

oras -h
Usage:
  oras [command]

Available Commands:
  help        Help about any command
  login       Log in to a remote registry
  logout      Log out from a remote registry
  pull        Pull files from remote registry
  push        Push files to remote registry
  version     Show the oras version information

with a possible delete vs. untagOnly flag

oras delete 
--artifact the fully qualified artifact registry.example.com/repo/artifact:tag
--artifact registry.example.com/repo/artifact@sha256:[digest]
--untagOnly
shizhMSFT commented 2 years ago

oras is evolving into a generic registry client. Yes, it's in the plan

shizhMSFT commented 2 years ago

Addressed and closed by #506. As long as the remote registry supports deletion, helm chart artifacts can be deleted by oras manifest delete.

shizhMSFT commented 2 years ago

Note: untag is not possible with generic docker registries as neither docker spec nor OCI spec support untagging at the HTTP API level.

However, untag are available in registry by some cloud providers (e.g. Azure Container Registry).

guettli commented 10 months ago

thank you for implementing it.

Unfortunately ghcr.io does not support it yet:

Error: failed to delete ghcr.io/foo/bar:0.0.1: DELETE "https://ghcr.io/v2/foo/bar/manifests/sha256:...":
 response status code 405: unsupported: The operation is unsupported.