Merge pull request #4673 from ehazlett/ctr-runtime-options
config path option to ctr for runtime
This commit is contained in:
commit
3662dc4c0b
@ -123,6 +123,10 @@ var (
|
|||||||
Usage: "runtime name",
|
Usage: "runtime name",
|
||||||
Value: defaults.DefaultRuntime,
|
Value: defaults.DefaultRuntime,
|
||||||
},
|
},
|
||||||
|
cli.StringFlag{
|
||||||
|
Name: "runtime-config-path",
|
||||||
|
Usage: "optional runtime config path",
|
||||||
|
},
|
||||||
cli.BoolFlag{
|
cli.BoolFlag{
|
||||||
Name: "tty,t",
|
Name: "tty,t",
|
||||||
Usage: "allocate a TTY for the container",
|
Usage: "allocate a TTY for the container",
|
||||||
|
@ -30,6 +30,7 @@ import (
|
|||||||
"github.com/containerd/containerd/contrib/nvidia"
|
"github.com/containerd/containerd/contrib/nvidia"
|
||||||
"github.com/containerd/containerd/contrib/seccomp"
|
"github.com/containerd/containerd/contrib/seccomp"
|
||||||
"github.com/containerd/containerd/oci"
|
"github.com/containerd/containerd/oci"
|
||||||
|
crioptions "github.com/containerd/containerd/pkg/cri/runtimeoptions/v1"
|
||||||
"github.com/containerd/containerd/platforms"
|
"github.com/containerd/containerd/platforms"
|
||||||
"github.com/containerd/containerd/runtime/v2/runc/options"
|
"github.com/containerd/containerd/runtime/v2/runc/options"
|
||||||
"github.com/opencontainers/runtime-spec/specs-go"
|
"github.com/opencontainers/runtime-spec/specs-go"
|
||||||
@ -302,6 +303,12 @@ func getRuntimeOptions(context *cli.Context) (interface{}, error) {
|
|||||||
return getRuncOptions(context)
|
return getRuncOptions(context)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if configPath := context.String("runtime-config-path"); configPath != "" {
|
||||||
|
return &crioptions.Options{
|
||||||
|
ConfigPath: configPath,
|
||||||
|
}, nil
|
||||||
|
}
|
||||||
|
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user