oras icon indicating copy to clipboard operation
oras copied to clipboard

Command to delete a blob from a remote registry

Open qweeah opened this issue 2 years ago • 1 comments

The proposed commands is:

Usage:
  oras blob delete REG/REPO@DIGEST [flags]

Flags:
  --ca-file string               server certificate authority file for the remote registry
  -d, --debug                    debug mode
  -h, --help                     help for deleting a blob
      --insecure                 allow connections to SSL registry without certs
  -p, --password string          registry password or identity token
      --password-stdin           read password or identity token from stdin
      --plain-http               allow insecure connections to registry without SSL check
  -u, --username string          registry username
  -v, --verbose                  verbose output

Only the specified blob will be deleted, predecessor nodes will not be touched.

Related to #459

qweeah avatar Aug 03 '22 03:08 qweeah

please assign this to me

lizMSFT avatar Aug 09 '22 03:08 lizMSFT

Current UX: oras blob delete localhost:5000/0817hello@sha256:73720a3a5a2809700408e72ede153c7985889b1796a0b5edb30188e89edced5c

image image

cc @shizhMSFT @yizha1 @FeynmanZhou

lizMSFT avatar Aug 23 '22 03:08 lizMSFT

How can users make sure they delete the right blob?

  • We could add a help doc to show the user how to get the digest for a blob
  • How about a confirmation dialog before deleting the blob, and a --force flag that user can delete the blob without confirmation.

yizha1 avatar Aug 24 '22 04:08 yizha1

How can users make sure they delete the right blob?

  • We could add a help doc to show the user how to get the digest for a blob
  • How about a confirmation dialog before deleting the blob, and a --force flag that user can delete the blob without confirmation.

Do you mean adding some help messages to tell users how to calculate the digest for a blob? (for example, using sha256sum command: sha256sum artifact2.txt), or add help doc for users to find the digest for a blob? From my point of view, delete a blob could be a dangerous behavior, and users should know what they are doing, and know exactly what they are going to delete. So I'm not sure whether it is necessary to have a help doc.

For the second one, I think we could add this confirmation dialog in the future if there are some feedbacks from users. This is probably out of scope for the current issue.

lizMSFT avatar Aug 24 '22 12:08 lizMSFT

  • We could add a help doc to show the user how to get the digest for a blob

I think we can prompt users that oras discover has this capability.

  • How about a confirmation dialog before deleting the blob, and a --force flag that user can delete the blob without confirmation.

I think it is not necessary to add confirmation prompt in this first-time implementation when users explictly delete a blob with specifying a digest.

According to the suggestion of Confirm before doing anything dangerous in CLIG, we can wait for users feedback to determine whether this prompt is needed in the next release.

FeynmanZhou avatar Aug 24 '22 16:08 FeynmanZhou

Experience of oras blob delete localhost:5000/0817hello@sha256:73720a3a5a2809700408e72ede153c7985889b1796a0b5edb30188e89edced5c sounds good 👍

sajayantony avatar Aug 24 '22 17:08 sajayantony

Are we trying to delete a blob, or an artifact?

SteveLasker avatar Sep 09 '22 01:09 SteveLasker

Are we trying to delete a blob, or an artifact?

@SteveLasker This command is designed for deleting only a blob.

Deleting an artifact can be done via oras manifest delete.

qweeah avatar Sep 09 '22 02:09 qweeah