Support ~/.config podman path in default keychain #2052
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
According to podman's auth docs:
The current default keychain supports the
$XDG_RUNTIME_DIR
path but not the$HOME/.config
path. This PR fixes that.Note: podman's behavior is actually a little more subtle than what these docs suggest:
$HOME/.config/containers
path is actually supported on all platforms, not just Windows/macOS. The$HOME/.config
part of the path is actually computed as$XDG_CONFIG_HOME
if it is defined, even on non-linux platforms - though, that env var is typically only set on Linux. If that env var is unset, it defaults to$HOME/.config
. The logic for that is here.$XDG_RUNTIME_DIR
path is indeed Linux-only, though, and takes precedence over the~/.config
path. The logic for this precedence is here, and the relevant code fromgetPathToAuth
is here.