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_DIRpath but not the$HOME/.configpath. This PR fixes that.Note: podman's behavior is actually a little more subtle than what these docs suggest:
$HOME/.config/containerspath is actually supported on all platforms, not just Windows/macOS. The$HOME/.configpart of the path is actually computed as$XDG_CONFIG_HOMEif 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_DIRpath is indeed Linux-only, though, and takes precedence over the~/.configpath. The logic for this precedence is here, and the relevant code fromgetPathToAuthis here.