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

podman login --get-login $REGISTRY_URL should return error if login has expired #24189

Open
EirikOpheim opened this issue Oct 7, 2024 · 0 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@EirikOpheim
Copy link

Feature request description

For scripting purposes it is useful to have a test to verify if you are logged in to a container registry. I believe this is the intended use of podman login --get-login $REGISTRY_URL. It would seem like the get-login command only returns the username used when you last logged in to a registry, without checking if the login is still valid.

My context:
AWS Elastic container registry, should apply to any login method where credentials are regularly rotated.

I log in to my container registry using:
aws ecr get-login-password --region $REGION | podman login --username AWS --password-stdin $REGISTRY_URL

The login is valid for 12 hours. After 12 hours I am no longer able to pull images from the registry.

podman login --get-login $REGISTRY_URL still returns AWS and exit code 0 after the credentials have timed out.
I would expect the command to return Error: not logged into $REGISTRY_URL and exit code > 0.

I am not sure if this should be a bug report or a feature request, as I am not fully aware what the podman login --get-login option aims to achieve. From the documentation it should "Return the current login user for the registry". One could argue that there is no logged in user for the registry if the login has expired.

Suggest potential solution

No response

Have you considered any alternatives?

No response

Additional context

No response

@EirikOpheim EirikOpheim added the kind/feature Categorizes issue or PR as related to a new feature. label Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

No branches or pull requests

1 participant