mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Fix the Stringer for leak mode
This commit is contained in:
@@ -235,11 +235,11 @@ const (
|
||||
func (l LeakMode) String() string {
|
||||
switch l {
|
||||
case NoLeakChecking:
|
||||
return "NoLeakChecking"
|
||||
return "disabled"
|
||||
case LeaksLogWarning:
|
||||
return "LeaksLogWarning"
|
||||
return "warning"
|
||||
case LeaksLogTraces:
|
||||
return "LeaksLogTraces"
|
||||
return "traces"
|
||||
default:
|
||||
panic(fmt.Sprintf("Invalid leakmode: %d", l))
|
||||
}
|
||||
|
||||
@@ -120,6 +120,8 @@ func MakeRefsLeakMode(s string) (refs.LeakMode, error) {
|
||||
return refs.NoLeakChecking, nil
|
||||
case "warning":
|
||||
return refs.LeaksLogWarning, nil
|
||||
case "traces":
|
||||
return refs.LeaksLogTraces, nil
|
||||
default:
|
||||
return 0, fmt.Errorf("invalid refs leakmode %q", s)
|
||||
}
|
||||
|
||||
+1
-1
@@ -73,7 +73,7 @@ var (
|
||||
netRaw = flag.Bool("net-raw", false, "enable raw sockets. When false, raw sockets are disabled by removing CAP_NET_RAW from containers (`runsc exec` will still be able to utilize raw sockets). Raw sockets allow malicious containers to craft packets and potentially attack the network.")
|
||||
numNetworkChannels = flag.Int("num-network-channels", 1, "number of underlying channels(FDs) to use for network link endpoints.")
|
||||
rootless = flag.Bool("rootless", false, "it allows the sandbox to be started with a user that is not root. Sandbox and Gofer processes may run with same privileges as current user.")
|
||||
referenceLeakMode = flag.String("ref-leak-mode", "disabled", "sets reference leak check mode: disabled (default), warning.")
|
||||
referenceLeakMode = flag.String("ref-leak-mode", "disabled", "sets reference leak check mode: disabled (default), warning, traces.")
|
||||
|
||||
// Test flags, not to be used outside tests, ever.
|
||||
testOnlyAllowRunAsCurrentUserWithoutChroot = flag.Bool("TESTONLY-unsafe-nonroot", false, "TEST ONLY; do not ever use! This skips many security measures that isolate the host from the sandbox.")
|
||||
|
||||
Reference in New Issue
Block a user