mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-26 15:32:30 +00:00
shim: Respect containerd's debug config
There are too many logs from kata shim in containerd's log. Fixes #2209 Signed-off-by: choury <chouryzhou@tencent.com>
This commit is contained in:
parent
547d580ad5
commit
51d7c23e41
@ -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
|
// it will output into stdio, from which containerd would like
|
||||||
// to get the shim's socket address.
|
// to get the shim's socket address.
|
||||||
logrus.SetOutput(ioutil.Discard)
|
logrus.SetOutput(ioutil.Discard)
|
||||||
|
opts := ctx.Value(cdshim.OptsKey{}).(cdshim.Opts)
|
||||||
|
if !opts.Debug {
|
||||||
|
logrus.SetLevel(logrus.WarnLevel)
|
||||||
|
}
|
||||||
vci.SetLogger(ctx, logger)
|
vci.SetLogger(ctx, logger)
|
||||||
katautils.SetLogger(ctx, logger, logger.Logger.Level)
|
katautils.SetLogger(ctx, logger, logger.Logger.Level)
|
||||||
|
|
||||||
@ -141,7 +145,10 @@ func newCommand(ctx context.Context, containerdBinary, id, containerdAddress str
|
|||||||
"-address", containerdAddress,
|
"-address", containerdAddress,
|
||||||
"-publish-binary", containerdBinary,
|
"-publish-binary", containerdBinary,
|
||||||
"-id", id,
|
"-id", id,
|
||||||
"-debug",
|
}
|
||||||
|
opts := ctx.Value(cdshim.OptsKey{}).(cdshim.Opts)
|
||||||
|
if opts.Debug {
|
||||||
|
args = append(args, "-debug")
|
||||||
}
|
}
|
||||||
cmd := sysexec.Command(self, args...)
|
cmd := sysexec.Command(self, args...)
|
||||||
cmd.Dir = cwd
|
cmd.Dir = cwd
|
||||||
|
Loading…
Reference in New Issue
Block a user