oras-project / oras

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

add command to get the digest of a tagged manifest without parsing output #907

Closed qweeah closed 11 months ago

qweeah commented 1 year ago

What is the version of your ORAS CLI

1.0.0

What would you like to be added?

Add a new command to get the digest of a tagged manifest as below:

$ oras resolve -h
Resolves digest of the target artifact

Usage:
  oras resolve [flags] <name>:<tag>

Aliases:
  digest

Flags:
      --ca-file string                              server certificate authority file for the remote registry
  -d, --debug                                       debug mode
      --descriptor                                  output a descriptor of the artifact
      --full-ref                                    print the full artifact reference with digest
  -H, --header stringArray                          add custom headers to requests
  -h, --help                                        help for resolve
      --insecure                                    allow connections to SSL registry without certs
      --media-type strings                          accepted media types
      --oci-layout                                  set target as an OCI image layout
  -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
      --platform os[/arch][/variant][:os_version]   request platform in the form of os[/arch][/variant][:os_version]
      --pretty                                      prettify JSON objects printed to stdout
      --registry-config path                        path of the authentication file for registry
      --resolve host:port:address[:address_port]    customized DNS for registry, formatted in host:port:address[:address_port]
  -u, --username string                             registry username
  -v, --verbose                                     verbose output

Examples

Why is this needed for ORAS?

This will increase the usability of oras in CI/CD jobs.

Are you willing to submit PRs to contribute to this feature?

TerryHowe commented 1 year ago

How about just call it digest instead of as an alias?

qweeah commented 1 year ago

To me, resolve is a verb and aligns more to current command naming convention.

shizhMSFT commented 1 year ago

To me, resolve is a verb and aligns more to current command naming convention.

The last command should be a verb so that it sounds like a nature language. Say... oras resolve <something>.

shizhMSFT commented 1 year ago

In general, oras <command> <reference> follows subject-verb-object word order where oras is the subject, <command> is the verb and <reference> is the object.

rafiya2003 commented 1 year ago

I would like to work on this, frankly I don't know much but I will learn and do. I am a newbie(first year UG student). I want to learn and grow. please give me the opportunity to learn and experience

qweeah commented 1 year ago

@rafiya2003 This issue requires knowledge on

rafiya2003 commented 1 year ago

@qweeah can you plz suggest me some issues

qweeah commented 1 year ago

@rafiya2003 #742 is similar to this but much simpler.

sajayantony commented 1 year ago

Would be interesting if we can support format parameter as well for formats that are used in other places like . {{.Registry}}/{{.Repository}}:{{.Tag}}@{{.Digest}}

amands98 commented 1 year ago

I am up for taking this item.