Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
Merge pull request #2208 from choury/patch-1
Browse files Browse the repository at this point in the history
Respect containerd's debug config
  • Loading branch information
GabyCT authored Nov 22, 2019
2 parents 0ff0e54 + 51d7c23 commit 7938cd8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion containerd-shim-v2/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ func New(ctx context.Context, id string, publisher events.Publisher) (cdshim.Shi
// it will output into stdio, from which containerd would like
// to get the shim's socket address.
logrus.SetOutput(ioutil.Discard)
opts := ctx.Value(cdshim.OptsKey{}).(cdshim.Opts)
if !opts.Debug {
logrus.SetLevel(logrus.WarnLevel)
}
vci.SetLogger(ctx, logger)
katautils.SetLogger(ctx, logger, logger.Logger.Level)

Expand Down Expand Up @@ -141,7 +145,10 @@ func newCommand(ctx context.Context, containerdBinary, id, containerdAddress str
"-address", containerdAddress,
"-publish-binary", containerdBinary,
"-id", id,
"-debug",
}
opts := ctx.Value(cdshim.OptsKey{}).(cdshim.Opts)
if opts.Debug {
args = append(args, "-debug")
}
cmd := sysexec.Command(self, args...)
cmd.Dir = cwd
Expand Down

0 comments on commit 7938cd8

Please sign in to comment.