redhat-actions / push-to-registry

GitHub Action to push a container image to an image registry.
https://github.com/marketplace/actions/push-to-registry
MIT License
97 stars 32 forks source link

[BUG] Enforce Lower-case Repository Name for Registry Push #54

Closed xee5ch closed 2 years ago

xee5ch commented 2 years ago

Is your feature request related to a problem? Please describe.

When attempting to use this wonderful GH Action, I happened to be using a repository that is capitalized (OSCAL). Having a registry with a capitalized name breaks the builds with the errors below. It would be preferable to just lowercase the repo name.

Run redhat-actions/push-to-registry@v2
Creating temporary Podman image storage for pulling from Docker daemon
Warning: "fuse-overlayfs" is not found. Install it before running this action. For more detail see https://github.com/redhat-actions/buildah-build/issues/45
Combining image name "cli" and registry "ghcr.io/oscal-club/OSCAL" to form registry path "ghcr.io/oscal-club/OSCAL/cli"
🔍 Checking if "cli:77ec43e8f757473a1e51d6ae5fc89de392c0faf5, cli:issue-1008-publish-container-images, cli:latest" present in the local Podman image storage
/usr/bin/podman version
/usr/bin/podman image exists cli:77ec43e8f757473a1e51d6ae5fc89de392c0faf5
/usr/bin/podman image exists cli:issue-1008-publish-container-images
/usr/bin/podman image exists cli:latest
Tags "cli:77ec43e8f757473a1e51d6ae5fc89de392c0faf5, cli:issue-1008-publish-container-images, cli:latest" found in Podman image storage
🔍 Checking if "cli:77ec43e8f757473a1e51d6ae5fc89de392c0faf5, cli:issue-1008-publish-container-images, cli:latest" present in the local Docker image storage
/usr/bin/podman --root /tmp/podman-from-docker-zmfOHJ pull docker-daemon:cli:77ec43e8f757473a1e51d6ae5fc89de392c0faf5
/usr/bin/podman --root /tmp/podman-from-docker-zmfOHJ pull docker-daemon:cli:issue-1008-publish-container-images
/usr/bin/podman --root /tmp/podman-from-docker-zmfOHJ pull docker-daemon:cli:latest
Tag "cli:77ec43e8f757473a1e51d6ae5fc89de392c0faf5" was found in the Podman image storage, but not in the Docker image storage. The image(s) will be pushed from Podman image storage.
⏳ Pushing "cli:77ec43e8f757473a1e51d6ae5fc89de392c0faf5" to ghcr.io/oscal-club/OSCAL/cli:77ec43e8f757473a1e51d6ae5fc89de392c0faf5, ghcr.io/oscal-club/OSCAL/cli:issue-1008-publish-container-images, ghcr.io/oscal-club/OSCAL/cli:latest as "xee5ch"
/usr/bin/podman push --quiet --digestfile cli-77ec43e8f757473a1e51d6ae5fc89de392c0faf5_digest.txt cli:77ec43e8f757473a1e51d6ae5fc89de392c0faf5 ghcr.io/oscal-club/OSCAL/cli:77ec43e8f757473a1e51d6ae5fc89de392c0faf5 --tls-verify=true --creds=xee5ch:***
Error: invalid reference format: repository name must be lowercase
Removing temporary Podman image storage for pulling from Docker daemon
/usr/bin/podman --root /tmp/podman-from-docker-zmfOHJ rmi -a -f
Error: podman exited with code 125
Error: invalid reference format: repository name must be lowercase

Describe the solution you'd like

Apparently this is part of the registry spec, so albeit it minor, I am surprised others do not want the action to decapitalize the repo and onwer name as well.

Describe alternatives you've considered

After troubleshooting this evening, I use shell commands in GitHub Actions to lowercase the image name in the files.

``

Additional context

tetchel commented 2 years ago

sure, a quick test shows the entire repository name/image name:image tag must be lowercase. TIL

xee5ch commented 2 years ago

I can work on this one, @tetchel, does not seem like a huge lift. :-)

divyansh42 commented 2 years ago

That's great. Feel free to work on this. :slightly_smiling_face: