Open kostola opened 3 months ago
Looking at the code, the default keychain looks for credential into (in order):
$HOME/.docker/config.json
$DOCKER_CONFIG/config.json
$REGISTRY_AUTH_FILE
$XDG_RUNTIME_DIR/containers/auth.json
1 and 2 are Docker related, 3 is intended as explicit override by the user and 4 doesn't work because XDG_RUNTIME_DIR
is not set in macOS.
Podman login docs, however, state that:
--authfile=path Path of the authentication file. Default is ${XDG_RUNTIME_DIR}/containers/auth.json on Linux, and $HOME/.config/containers/auth.json on Windows/macOS.
It seems like option 4 should consider the host OS.
Omg, I just independently wrote the same fix :facepalm:
@jonjohnsonjr @imjasonh I am pinging you as top contributors. What do you think of this fix?
Describe the bug
On a Mac M1 laptop with Podman (running through Podman Machine),
crane auth get <registry>
fails withcredentials not found in native keychain
even if podman itself is successfully logged into the same registry.Credentials are correctly stored in
$HOME/.config/containers/auth.json
To Reproduce
podman login <registry>
crane auth get <registry>
Expected behavior
Crane should return the expected output for
crane auth get
: a JSON containing the credentials, like:Additional context
crane version
:0.19.1
docker.io
,ghcr.io
,quay.io