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 bfba931
Show file tree
Hide file tree
Showing 3 changed files with 4 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
2 changes: 2 additions & 0 deletions defaults/defaults.go
Expand Up @@ -29,4 +29,6 @@ const (
// DefaultSnapshotterNSLabel defines the namespace label to check for the
// default snapshotter
DefaultSnapshotterNSLabel = "containerd.io/defaults/snapshotter"
// DefaultImports is the default imports for config files.
DefaultImports = ["conf/*.toml"]

Check failure on line 33 in defaults/defaults.go

View workflow job for this annotation

GitHub Actions / CodeQL-Build

syntax error: unexpected newline, expected type

Check failure on line 33 in defaults/defaults.go

View workflow job for this annotation

GitHub Actions / Linters (ubuntu-22.04)

syntax error: unexpected newline, expected type (typecheck)

Check failure on line 33 in defaults/defaults.go

View workflow job for this annotation

GitHub Actions / Linters (ubuntu-22.04)

expected type, found newline (typecheck)

Check failure on line 33 in defaults/defaults.go

View workflow job for this annotation

GitHub Actions / Linters (ubuntu-22.04)

syntax error: unexpected newline, expected type) (typecheck)

Check failure on line 33 in defaults/defaults.go

View workflow job for this annotation

GitHub Actions / Linters (actuated-arm64-4cpu-16gb)

syntax error: unexpected newline, expected type (typecheck)

Check failure on line 33 in defaults/defaults.go

View workflow job for this annotation

GitHub Actions / Linters (actuated-arm64-4cpu-16gb)

expected type, found newline (typecheck)

Check failure on line 33 in defaults/defaults.go

View workflow job for this annotation

GitHub Actions / Linters (actuated-arm64-4cpu-16gb)

syntax error: unexpected newline, expected type) (typecheck)

Check failure on line 33 in defaults/defaults.go

View workflow job for this annotation

GitHub Actions / Manpages

syntax error: unexpected newline, expected type
)
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 bfba931

Please sign in to comment.