Skip to content

Commit 3662dc4

Browse files
Merge pull request #4673 from ehazlett/ctr-runtime-options
config path option to ctr for runtime
2 parents 9a672cc + ef48ef1 commit 3662dc4

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

cmd/ctr/commands/commands.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,10 @@ var (
123123
Usage: "runtime name",
124124
Value: defaults.DefaultRuntime,
125125
},
126+
cli.StringFlag{
127+
Name: "runtime-config-path",
128+
Usage: "optional runtime config path",
129+
},
126130
cli.BoolFlag{
127131
Name: "tty,t",
128132
Usage: "allocate a TTY for the container",

cmd/ctr/commands/run/run_unix.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import (
3030
"github.com/containerd/containerd/contrib/nvidia"
3131
"github.com/containerd/containerd/contrib/seccomp"
3232
"github.com/containerd/containerd/oci"
33+
crioptions "github.com/containerd/containerd/pkg/cri/runtimeoptions/v1"
3334
"github.com/containerd/containerd/platforms"
3435
"github.com/containerd/containerd/runtime/v2/runc/options"
3536
"github.com/opencontainers/runtime-spec/specs-go"
@@ -302,6 +303,12 @@ func getRuntimeOptions(context *cli.Context) (interface{}, error) {
302303
return getRuncOptions(context)
303304
}
304305

306+
if configPath := context.String("runtime-config-path"); configPath != "" {
307+
return &crioptions.Options{
308+
ConfigPath: configPath,
309+
}, nil
310+
}
311+
305312
return nil, nil
306313
}
307314

0 commit comments

Comments
 (0)