moby/libcontainerd/supervisor/remote_daemon_options.go
Sebastiaan van Stijn b6b0b0a05f
libcontainerd/supervisor: don't write log-level to config file
the `--log-level` flag overrides whatever is in the containerd configuration file;
f033f6ff85/cmd/containerd/command/main.go (L339-L352)

Given that we set that flag when we start the containerd binary, there is no need
to write it both to the generated config-file and pass it as flag.

This patch also slightly changes the behavior; as both dockerd and containerd use
"info" as default log-level, don't set the log-level if it's the default.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-08-11 14:11:06 +02:00

22 lines
599 B
Go

package supervisor // import "github.com/docker/docker/libcontainerd/supervisor"
// WithLogLevel defines which log level to start containerd with.
func WithLogLevel(lvl string) DaemonOpt {
return func(r *remote) error {
if lvl == "info" {
// both dockerd and containerd default log-level is "info",
// so don't pass the default.
lvl = ""
}
r.logLevel = lvl
return nil
}
}
// WithCRIDisabled disables the CRI plugin.
func WithCRIDisabled() DaemonOpt {
return func(r *remote) error {
r.DisabledPlugins = append(r.DisabledPlugins, "io.containerd.grpc.v1.cri")
return nil
}
}