Skip to content

Default windows configuration path is inconsistent #4392

@TBBle

Description

@TBBle

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:

  1. Run a local binary build of containerd as Admnistrator
  2. Note that it creates both %PROGRAMFILES%\containerd\ and %PROGRAMDATA%\containerd\
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions