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

[FEAT] allow namespacing image with localhost/ to target local podman images #100

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

benniekiss
Copy link

@benniekiss benniekiss commented Aug 13, 2024

Description

Podman stores locally built images as localhost/${IMAGE}, so we should prepend localhost/ to the image name to ensure we target the correct image.

This PR makes sure to sanitize the destinationImage if it is namespaced with localhost/ so that it is pushed to the right location.

Currently, if images are namespaced as localhost/{IMAGE}, they are pushed either to registry/localhost/image, or registry/namespace/localhost/{IMAGE} if the registry is provided with a namespace.

Namespacing images as localhost/ also allows always targeting the podman image even if a docker image was built more recently as docker does not use localhost/ as a namespace. However, the PR currently sanitizes the image name so that it can be pulled from the docker daemon, but if this functionality is wanted, I can revert the changes on line 304 and line 307

Related Issue(s)

This may fix #66 by allowing a user to specifically target a local image

Checklist

  • This PR includes a documentation change
  • This PR does not need a documentation change

  • This PR includes test changes
  • This PR's changes are already tested

  • This change is not user-facing
  • This change is a patch change
  • This change is a minor change
  • This change is a major (breaking) change

Changes made

  • allow namespacing images with localhost/ and sanitize the destination image

@benniekiss benniekiss marked this pull request as draft August 13, 2024 18:45
@benniekiss benniekiss changed the title [FIX] prepend localhost/ to local podman images on push [FEAT] allow namespacing image with localhost/ to target local podman images Aug 16, 2024
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.

[BUG] Remote images take precedence over localhost images
1 participant