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

Fix: Make --registry-map compatible with namespaced images #3138

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mlallaouret
Copy link

With --registry-map=="index.docker.io=europe-west1-docker.pkg.dev/my-registry/docker-hub", when we try to pull the image eclipse-temurin:21.0.2_13-jre, as expected we get:

INFO Retrieving image manifest eclipse-temurin:21.0.2_13-jre 
INFO Retrieving image my-registry/docker-hub/eclipse-temurin:21.0.2_13-jre from mapped registry europe-west1-docker.pkg.dev  

However with the same --registry-map option, when we try to pull the image caddy/caddy:2.7.6-alpine, we get:

INFO Retrieving image manifest caddy/caddy:2.7.6-alpine 
INFO Retrieving image caddy/caddy:2.7.6-alpine from mapped registry europe-west1-docker.pkg.dev 
WARN Failed to retrieve image caddy/caddy:2.7.6-alpine from remapped registry europe-west1-docker.pkg.dev: unable to complete operation after 0 attempts, last error: GET https://europe-west1-docker.pkg.dev/v2/token?scope=repository%3Acaddy%2Fcaddy%3Apull&service=: DENIED: Permission "artifactregistry.repositories.downloadArtifacts" denied on resource "projects/caddy/locations/europe-west1/repositories/caddy" (or it may not exist). Will try with the next registry, or fallback to the original registry. 

Description

  • For each registry mapping, represent it by a new instance of Repository and create a new Reference containing it.
  • Improve registry mapping parser
  • Add more unit tests to cover more use cases

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

  • Includes unit tests
  • Adds integration tests if needed.

See the contribution guide for more details.

Reviewer Notes

  • The code flow looks good.
  • Unit tests and or integration tests added.

Release Notes

Describe any changes here so maintainer can include it in the release notes, or delete this block.

Examples of user facing changes:
- Fix: Make `--registry-map` compatible with namespaced images

* For each registry mapping, represent it by a new instance of Repository and
  create a new Reference containing it.
* Improve registry mapping parser
* Add more unit tests to cover more use cases
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant