Skip to content

Commit

Permalink
Allow split configurations by default: import conf/*.toml by default.
Browse files Browse the repository at this point in the history
Distro vendor might want to customize their containerd configuration
and might prefer to split it in multiple files. Usually this is done
with a /etc/tool.d/*.conf scheme (for example /etc/sysctl.d). This would
allow distro to put any toml file in /etc/containerd/conf in Linux to
customize the default configuration.

Signed-off-by: Romain Geissler <romain.geissler@amadeus.com>
  • Loading branch information
Romain-Geissler-1A committed Apr 10, 2024
1 parent 27dfb0d commit f09ba60
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions cmd/containerd/command/config.go
Expand Up @@ -166,6 +166,7 @@ func platformAgnosticDefaultConfig() *srvconfig.Config {
},
DisabledPlugins: []string{},
RequiredPlugins: []string{},
Imports: defaults.DefaultImports,
StreamProcessors: streamProcessors(),
}
}
Expand Down
5 changes: 5 additions & 0 deletions defaults/defaults.go
Expand Up @@ -30,3 +30,8 @@ const (
// default snapshotter
DefaultSnapshotterNSLabel = "containerd.io/defaults/snapshotter"
)

var (
// DefaultImports is the default imports for config files.
DefaultImports = []string{"conf/*.toml"}
)
2 changes: 1 addition & 1 deletion docs/man/containerd-config.toml.5.md
Expand Up @@ -143,7 +143,7 @@ documentation.
"io.containerd.timeout.shim.shutdown" = "3s"
"io.containerd.timeout.task.state" = "2s" -->

**imports**
**imports** (Default: ["conf/*.toml"])
: Imports is a list of additional configuration files to include.
This allows to split the main configuration file and keep some sections
separately (for example vendors may keep a custom runtime configuration in a
Expand Down

0 comments on commit f09ba60

Please sign in to comment.