Forward containerd debug to shim invocation

Signed-off-by: Justin Terry (VM) <juterry@microsoft.com>
This commit is contained in:
Justin Terry (VM)
2018-09-26 13:49:53 -07:00
parent f88d3e5d6d
commit 84aa0bfde6
4 changed files with 62 additions and 3 deletions

View File

@@ -31,6 +31,7 @@ import (
"github.com/containerd/containerd/runtime/v2/task"
"github.com/containerd/ttrpc"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
)
func shimBinary(ctx context.Context, bundle *Bundle, runtime, containerdAddress string, events *exchange.Exchange, rt *runtime.TaskList) *binary {
@@ -52,13 +53,18 @@ type binary struct {
}
func (b *binary) Start(ctx context.Context) (_ *shim, err error) {
args := []string{"-id", b.bundle.ID}
if logrus.GetLevel() == logrus.DebugLevel {
args = append(args, "-debug")
}
args = append(args, "start")
cmd, err := client.Command(
ctx,
b.runtime,
b.containerdAddress,
b.bundle.Path,
"-id", b.bundle.ID,
"start",
args...,
)
if err != nil {
return nil, err