-
Notifications
You must be signed in to change notification settings - Fork 198
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
Support system-wide containers config folder on windows #1973
Support system-wide containers config folder on windows #1973
Conversation
pkg/config/config_windows.go
Outdated
// DefaultContainersConfig holds the default containers config path | ||
DefaultContainersConfig = "/usr/share/" + _configPath | ||
DefaultContainersConfig = "C:\\ProgramData\\" + _configPath |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_configPath is containers/containers.conf
so should this use containers\\containers.conf
instead or does it not matter?
Also given that overrideContainersConfigPath() returns the actual path with the correct env if the defaults was changed should we maybe just leave DefaultContainersConfig empty on windows? At least I see no benifit to read the same file twice other to make it slower.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_configPath is
containers/containers.conf
so should this usecontainers\\containers.conf
instead or does it not matter?
It should be fine, the Windows API converts the forward slashes to backslashes. But for consistency I like it more to have _configPath
const on windows to be containers\\containers.conf
so I have updated that thanks.
Also given that overrideContainersConfigPath() returns the actual path with the correct env if the defaults was changed should we maybe just leave DefaultContainersConfig empty on windows? At least I see no benifit to read the same file twice other to make it slower.
Yes I think it's better. I have left it empty.
68a5293
to
abec2d6
Compare
Add %PROGRAMDATA%/containers to the list of possible config folders. Fixes containers/podman#22411 Signed-off-by: Mario Loriedo <mario.loriedo@gmail.com>
abec2d6
to
6c651df
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: l0rd, Luap99 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@containers/podman-maintainers PTAL |
/lgtm |
Add
%PROGRAMDATA%/containers
to the list of possible config folders on Windows.For all OSes returns the "the default config path overridden by the root user" using a function rather than a
const
to allow composing it with variablePROGRAMDATA
on windows.Fixes containers/podman#22411