~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
[x] This PR does not need a documentation change
[ ] This PR includes test changes
[ ] This PR's changes are already tested
[x] This change is not user-facing
[ ] This change is a patch change
[x] 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
Description
~Podman stores locally built images as
localhost/${IMAGE}
, so we should prependlocalhost/
to the image name to ensure we target the correct image.~This PR makes sure to sanitize the
destinationImage
if it is namespaced withlocalhost/
so that it is pushed to the right location.Currently, if images are namespaced as
localhost/{IMAGE}
, they are pushed either toregistry/localhost/image
, orregistry/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 uselocalhost/
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 307Related Issue(s)
This may fix #66 by allowing a user to specifically target a local image
Checklist
[x] This PR does not need a documentation change
[ ] This PR's changes are already tested
Changes made
localhost/
and sanitize the destination image