Closed devurandom closed 4 years ago
XDG_RUNTIME_DIR to locate the auth file
... man podman login podman-login(1)() podman-login(1)()
NAME podman-login - Login to a container registry
SYNOPSIS podman login [options] [registry]
DESCRIPTION podman login logs into a specified registry server with the correct username and password. If the registry is not specified, the first reg‐ istry under [registries.search] from registries.conf will be used. pod‐ man login reads in the username and password from STDIN. The username and password can also be set using the username and password flags. The path of the authentication file can be specified by the user by setting the authfile flag. The default path used is ${XDG_RUN‐ TIME_DIR}/containers/auth.json.
XDG_RUNTIME_DIR to locate the auth file
I know. I would like podman to load $XDG_CONFIG_HOME/containers/auth.json
in addition to $XDG_RUNTIME_DIR/containers/auth.json
.
So you want it to search through each one of these?
@QiWang19 PTAL
So you want it to search through each one of these?
Yes, that would be very convenient, because then I could store authentication information permanently.
Also it would be nice if the way podman, buildah and skopea read config files could be unified, so when e.g. authenticated access to a registry works in one of them, it works in all of them. (I was surprised when I read the different manpages and found out they each have their own search path for the various "containers" config files.) But that is out of scope for this request.
They should all share the authorization file now. They share the same code for it. I am fine with adding XDG_CONFIG_HOME to the search if XDG_RUNTIME_DIR file does not exists. Similar to how we currently look for $HOME/.docker/config.json
/kind feature
Description
podman login
currently ignores$XDG_CONFIG_HOME/containers/auth.json
Steps to reproduce the issue:
$XDG_CONFIG_HOME/containers/auth.json
podman login
podman login --authfile=$HOME/.config/containers/auth.json
Authenticating with existing credentials...
Describe the results you received:
s.a.
Describe the results you expected:
podman login
should try to load$XDG_CONFIG_HOME/containers/auth.json
in addition to$XDG_RUNTIME_DIR/containers/auth.json
. (Note that if$XDG_CONFIG_HOME
is unset, it should fall back to$HOME/.config
.)Additional information you deem important (e.g. issue happens only occasionally):
Output of
podman version
:Output of
podman info --debug
:Package info (e.g. output of
rpm -q podman
orapt list podman
):Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide?
No
Additional environment details (AWS, VirtualBox, physical, etc.):