Skip to content

Commit

Permalink
Merge pull request #3276 from darfux/v1_respect_shim_debug
Browse files Browse the repository at this point in the history
v1:Respect the `shim_debug` flag when load tasks
  • Loading branch information
crosbymichael committed May 13, 2019
2 parents c0d0fc3 + 66036d9 commit 7acdb16
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions runtime/v1/linux/runtime.go
Expand Up @@ -372,7 +372,11 @@ func (r *Runtime) loadTasks(ctx context.Context, ns string) ([]*Task, error) {
}).Error("opening shim stdout log pipe")
continue
}
go io.Copy(os.Stdout, shimStdoutLog)
if r.config.ShimDebug {
go io.Copy(os.Stdout, shimStdoutLog)
} else {
go io.Copy(ioutil.Discard, shimStdoutLog)
}

shimStderrLog, err := v1.OpenShimStderrLog(ctx, logDirPath)
if err != nil {
Expand All @@ -383,7 +387,11 @@ func (r *Runtime) loadTasks(ctx context.Context, ns string) ([]*Task, error) {
}).Error("opening shim stderr log pipe")
continue
}
go io.Copy(os.Stderr, shimStderrLog)
if r.config.ShimDebug {
go io.Copy(os.Stderr, shimStderrLog)
} else {
go io.Copy(ioutil.Discard, shimStderrLog)
}

t, err := newTask(id, ns, pid, s, r.events, r.tasks, bundle)
if err != nil {
Expand Down

0 comments on commit 7acdb16

Please sign in to comment.