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

artifactregistry GetTag, GetDockerImage, ListDockerImages, ListRepositories Name/Parent format is undocumented #9364

Closed
StevenACoffman opened this issue Feb 4, 2024 · 2 comments
Labels
type: docs Improvement to the documentation for an API.

Comments

@StevenACoffman
Copy link

StevenACoffman commented Feb 4, 2024

The only downside of the Google Artifact Registry RPC API is that there is no documentation (that I could find) or examples of what a valid format the Parent or Name argument that these calls take.

Most people expect to supply a Docker Registry URL like: docker://us-central1-docker.pkg.dev/gcp-project/myrepo/myapp:mytag@sha256:2dd6956aa4f462badb7aa445f73092b19e55e2be2c03bee4ec230700963b3f55

Instead, we have to construct a valid Name / Parent string in a different format for each of GetTagRequest, ListDockerImagesRequest and GetDockerImageRequest operations. GetTag response returns a Tag. ListDockerImages and GetDockerImage responses are composed of DockerImage objects.

  • GetDockerImage RPC API requires you to pass in a Name in the format projects/%s/locations/%s/repositories/%s/packages/%s@%s. For example:
    projects/gcp-project/locations/us-central1/repositories/myrepo/packages/myapp@sha256:2dd6956aa4f462badb7aa445f73092b19e55e2be2c03bee4ec230700963b3f55
    
  • ListDockerImages RPC API wants Parent in the format projects/%s/locations/%s/repositories/%s, for example:
    projects/gcp-project/locations/us-central1/repositories/myrepo
    
  • GetTag RPC API wants Name in the format projects/%s/locations/%s/repositories/%s/packages/%s/tags/%s, for example:
    projects/gcp-project/locations/us-central1/repositories/myrepo/packages/myapp:mytag
    
  • ListRepositories RPC API wants Parent in the format projects/%s/locations/%s, for example:
    projects/gcp-project/locations/us-central1
    

If you have a Docker URL with a Docker Tag without the Docker SHA256, you can use GetTag and from that response extract the Version. Then you can pass that Version SHA256 to GetDockerImage.

@StevenACoffman StevenACoffman added the triage me I really want to be triaged. label Feb 4, 2024
@codyoss codyoss added type: docs Improvement to the documentation for an API. and removed triage me I really want to be triaged. labels Feb 5, 2024
@codyoss
Copy link
Member

codyoss commented Feb 5, 2024

Thanks for the feedback. This is currently a per-api problem that should be reported to individual services. I would request that you open a similar issue in the public Artifact Registry Issue Tracker. That being said I think there is also potentially more we can do here from the libraries perspective directly. This problem has been identified in the past and we are currently tracking the generic issue here. Please follow that issue for any updates. Thanks again for the feedback.

@codyoss codyoss closed this as not planned Won't fix, can't repro, duplicate, stale Feb 5, 2024
@StevenACoffman
Copy link
Author

Thanks! Opened here:

https://issuetracker.google.com/issues/323771609

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: docs Improvement to the documentation for an API.
Projects
None yet
Development

No branches or pull requests

2 participants