Skip to content
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

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

Closed
1 task
qweeah opened this issue Mar 28, 2023 · 10 comments · Fixed by #1187
Closed
1 task

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

qweeah opened this issue Mar 28, 2023 · 10 comments · Fixed by #1187
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers ux User experience related
Milestone

Comments

@qweeah
Copy link
Contributor

qweeah commented Mar 28, 2023

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

  • Resolve digest of docker.io/library/hello-world:latest
$ oras resolve docker.io/library/hello-world:latest
sha256:ffb13da98453e0f04d33a6eee5bb8e46ee50d08ebe17735fc0779d0349e889e9
  • Resolve full reference of docker.io/library/hello-world:latest with digest
$ oras resolve docker.io/library/hello-world:latest --full-ref
docker.io/library/hello-world@sha256:ffb13da98453e0f04d33a6eee5bb8e46ee50d08ebe17735fc0779d0349e889e9

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?

  • Yes, I am willing to implement it.
@qweeah qweeah added the enhancement New feature or request label Mar 28, 2023
@qweeah qweeah added this to the future milestone Mar 28, 2023
@qweeah qweeah added the good first issue Good for newcomers label Mar 28, 2023
@TerryHowe
Copy link
Member

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

@qweeah
Copy link
Contributor Author

qweeah commented Mar 28, 2023

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

@shizhMSFT
Copy link
Contributor

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
Copy link
Contributor

shizhMSFT commented Mar 28, 2023

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
Copy link

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
Copy link
Contributor Author

qweeah commented Jun 5, 2023

@rafiya2003 This issue requires knowledge on

  • Cobra: the framework we used to build CLI, you might want to start with https://cobra.dev/#getting-started
  • oras-go: the golang SDK oras CLI used to interact with registries and oci layout stores. You might want to start with sdk examples in godoc or oras.land

@rafiya2003
Copy link

@qweeah can you plz suggest me some issues

@qweeah
Copy link
Contributor Author

qweeah commented Jun 7, 2023

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

@sajayantony
Copy link
Contributor

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
Copy link
Contributor

amands98 commented Jul 8, 2023

I am up for taking this item.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers ux User experience related
Projects
No open projects
6 participants