mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-19 18:01:01 +00:00
Merge pull request #2208 from choury/patch-1
Respect containerd's debug config
This commit is contained in:
commit
7938cd8965
@ -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)
|
||||
|
||||
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user