From 6747195682d84dcc5abc181e651b2a76267b7c5f Mon Sep 17 00:00:00 2001 From: Mahmood Ali Date: Fri, 19 Apr 2019 09:45:50 -0400 Subject: [PATCH] comment on using init() for libcontainer handling --- drivers/shared/executor/libcontainer_nsenter_linux.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/shared/executor/libcontainer_nsenter_linux.go b/drivers/shared/executor/libcontainer_nsenter_linux.go index fdde8c33ee5d..9ecada403453 100644 --- a/drivers/shared/executor/libcontainer_nsenter_linux.go +++ b/drivers/shared/executor/libcontainer_nsenter_linux.go @@ -12,6 +12,9 @@ import ( // init is only run on linux and is used when the LibcontainerExecutor starts // a new process. The libcontainer shim takes over the process, setting up the // configured isolation and limitions before execve into the user process +// +// This subcommand handler is implemented as an `init`, libcontainer shim is handled anywhere +// this package is used (including tests) without needing to write special command handler. func init() { if len(os.Args) > 1 && os.Args[1] == "libcontainer-shim" { runtime.GOMAXPROCS(1)