Add runtimeArgs to pass to shim
This allows you to pass options like: ```bash containerd --debug --runtime-args "--debug" --runtime-args "--systemd-cgroup" ``` Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
@@ -50,6 +50,11 @@ var daemonFlags = []cli.Flag{
|
||||
Value: "runc",
|
||||
Usage: "name of the OCI compliant runtime to use when executing containers",
|
||||
},
|
||||
cli.StringSliceFlag{
|
||||
Name: "runtime-args",
|
||||
Value: &cli.StringSlice{},
|
||||
Usage: "specify additional runtime args",
|
||||
},
|
||||
}
|
||||
|
||||
func main() {
|
||||
@@ -71,6 +76,7 @@ func main() {
|
||||
context.String("state-dir"),
|
||||
10,
|
||||
context.String("runtime"),
|
||||
context.StringSlice("runtime-args"),
|
||||
); err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
@@ -80,7 +86,7 @@ func main() {
|
||||
}
|
||||
}
|
||||
|
||||
func daemon(address, stateDir string, concurrency int, runtimeName string) error {
|
||||
func daemon(address, stateDir string, concurrency int, runtimeName string, runtimeArgs []string) error {
|
||||
// setup a standard reaper so that we don't leave any zombies if we are still alive
|
||||
// this is just good practice because we are spawning new processes
|
||||
s := make(chan os.Signal, 2048)
|
||||
@@ -88,7 +94,7 @@ func daemon(address, stateDir string, concurrency int, runtimeName string) error
|
||||
if err := osutils.SetSubreaper(1); err != nil {
|
||||
logrus.WithField("error", err).Error("containerd: set subpreaper")
|
||||
}
|
||||
sv, err := supervisor.New(stateDir, runtimeName)
|
||||
sv, err := supervisor.New(stateDir, runtimeName, runtimeArgs)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user