-
Notifications
You must be signed in to change notification settings - Fork 176
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
Respect XDG_CONFIG_HOME for policy.json and cni #248
Respect XDG_CONFIG_HOME for policy.json and cni #248
Conversation
Use XDG_CONFIG_HOME if it is defined. XDG_CONFIG_HOME is already respected for configuration files such as containers.conf, storage.conf, and registry.conf but here `~/.config` was hardcoded. Signed-off-by: David Scherer <david.scherer@antithesis.com>
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: davidscherer The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Signature policy path changes LGTM, but CNI is unusable without root, so there's no sense in making it vary per-user. |
Unfortunately, I have discovered that while this patch appears to make podman behave as I expect, buildah is apparently relying instead on the very similar logic in https://github.com/containers/image/blob/3e7b89e181cc724370de44856fe06092c20cbd15/signature/policy_config.go#L60 |
Ah, exciting - I thought that was a lot further off. |
Please use "github.com/containers/storage/pkg/homedir" config.GetConfigHome() |
Signed-off-by: David Scherer <david.scherer@antithesis.com>
It has nothing to do with this PR, but probably |
@davidscherer Yes could you open a PR to fix this. |
LGTM |
Use the XDG_CONFIG_HOME environment variable, if it is defined, to locate policy.json and the cni plugins directory in rootless mode. This is the standard way to locate user-specific configuration files.
XDG_CONFIG_HOME is already respected in rootless mode for configuration files such as containers.conf, storage.conf, and registry.conf but here
~/.config
was hardcoded.