Merge pull request #37419 from thaJeztah/pass_loglevel_to_containerd
Pass log-level to containerd
This commit is contained in:
commit
42bd8e1b10
4 changed files with 7 additions and 6 deletions
|
@ -48,6 +48,8 @@ func (cli *DaemonCli) getPlatformRemoteOptions() ([]libcontainerd.RemoteOption,
|
|||
}
|
||||
if cli.Config.Debug {
|
||||
opts = append(opts, libcontainerd.WithLogLevel("debug"))
|
||||
} else if cli.Config.LogLevel != "" {
|
||||
opts = append(opts, libcontainerd.WithLogLevel(cli.Config.LogLevel))
|
||||
}
|
||||
if cli.Config.ContainerdAddr != "" {
|
||||
opts = append(opts, libcontainerd.WithRemoteAddr(cli.Config.ContainerdAddr))
|
||||
|
|
|
@ -221,6 +221,11 @@ func (r *remote) startContainerd() error {
|
|||
}
|
||||
|
||||
args := []string{"--config", configFile}
|
||||
|
||||
if r.Debug.Level != "" {
|
||||
args = append(args, "--log-level", r.Debug.Level)
|
||||
}
|
||||
|
||||
cmd := exec.Command(binaryName, args...)
|
||||
// redirect containerd logs to docker logs
|
||||
cmd.Stdout = os.Stdout
|
||||
|
|
|
@ -28,9 +28,6 @@ func (r *remote) setDefaults() {
|
|||
if r.Debug.Address == "" {
|
||||
r.Debug.Address = filepath.Join(r.stateDir, debugSockFile)
|
||||
}
|
||||
if r.Debug.Level == "" {
|
||||
r.Debug.Level = "info"
|
||||
}
|
||||
if r.OOMScore == 0 {
|
||||
r.OOMScore = -999
|
||||
}
|
||||
|
|
|
@ -18,9 +18,6 @@ func (r *remote) setDefaults() {
|
|||
if r.Debug.Address == "" {
|
||||
r.Debug.Address = debugPipeName
|
||||
}
|
||||
if r.Debug.Level == "" {
|
||||
r.Debug.Level = "info"
|
||||
}
|
||||
if r.snapshotter == "" {
|
||||
r.snapshotter = "naive" // TODO(mlaventure): switch to "windows" once implemented
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue