b6b0b0a05f
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>
22 lines
599 B
Go
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
|
|
}
|
|
}
|