Description
The default configuration path on Windows is in %PROGRAMFILES%\containerd\config.toml, which should be a read-only directory for program binaries, generally managed by an installer.
The platform-consistent place would be %PROGRAMDATA%\containerd\config.toml, which is where the Root and State directories default to.
For example, both Docker and BuildKit store system-wide configuration in %PROGRAMDATA% by default, as does Git for Windows, and a bunch of other stuff.
Steps to reproduce the issue:
- Run a local binary build of containerd as Admnistrator
- Note that it creates both
%PROGRAMFILES%\containerd\ and %PROGRAMDATA%\containerd\
- See references to %PROGRAMFILES%\containerd\config.toml and
%PROGRAMFILES%\containerd\cni\conf in the log output.
Describe the results you received:
%PROGRAMFILES% is touched.
Describe the results you expected:
%PROGRAMFILES% is not touched.
Output of containerd --version:
containerd github.com/containerd/containerd 1.4.0-beta.2+unknown
Any other relevant information:
I noticed that containerd/cri has the same problem in its Network Plugin. If this is agreed as a bug to be fixed, I guess we'd need to:
- Attempt to load
%PROGRAMFILES%\containerd\config.toml if %PROGRAMDATA%\containerd\config.toml is absent
- Make similar fixse in containerd/cri
I note that this was an unanswered open question in the relevant containerd/cri PR.
Description
The default configuration path on Windows is in
%PROGRAMFILES%\containerd\config.toml, which should be a read-only directory for program binaries, generally managed by an installer.The platform-consistent place would be
%PROGRAMDATA%\containerd\config.toml, which is where the Root and State directories default to.For example, both Docker and BuildKit store system-wide configuration in
%PROGRAMDATA%by default, as does Git for Windows, and a bunch of other stuff.Steps to reproduce the issue:
%PROGRAMFILES%\containerd\and%PROGRAMDATA%\containerd\%PROGRAMFILES%\containerd\cni\confin the log output.Describe the results you received:
%PROGRAMFILES%is touched.Describe the results you expected:
%PROGRAMFILES%is not touched.Output of
containerd --version:Any other relevant information:
I noticed that containerd/cri has the same problem in its Network Plugin. If this is agreed as a bug to be fixed, I guess we'd need to:
%PROGRAMFILES%\containerd\config.tomlif%PROGRAMDATA%\containerd\config.tomlis absentI note that this was an unanswered open question in the relevant containerd/cri PR.