runsc: propagate the alsologtostderr to sub-commands

PiperOrigin-RevId: 260239119
This commit is contained in:
Andrei Vagin 2019-07-26 16:52:28 -07:00 committed by gVisor bot
parent 2762692621
commit 4183b9021a
2 changed files with 5 additions and 0 deletions

View File

@ -198,6 +198,9 @@ type Config struct {
// sandbox and Gofer process run as root inside a user namespace with root
// mapped to the caller's user.
Rootless bool
// AlsoLogToStderr allows to send log messages to stderr.
AlsoLogToStderr bool
}
// ToFlags returns a slice of flags that correspond to the given Config.
@ -223,6 +226,7 @@ func (c *Config) ToFlags() []string {
"--net-raw=" + strconv.FormatBool(c.EnableRaw),
"--num-network-channels=" + strconv.Itoa(c.NumNetworkChannels),
"--rootless=" + strconv.FormatBool(c.Rootless),
"--alsologtostderr=" + strconv.FormatBool(c.AlsoLogToStderr),
}
if c.TestOnlyAllowRunAsCurrentUserWithoutChroot {
// Only include if set since it is never to be used by users.

View File

@ -190,6 +190,7 @@ func main() {
EnableRaw: *netRaw,
NumNetworkChannels: *numNetworkChannels,
Rootless: *rootless,
AlsoLogToStderr: *alsoLogToStderr,
TestOnlyAllowRunAsCurrentUserWithoutChroot: *testOnlyAllowRunAsCurrentUserWithoutChroot,
}