@@ -47,6 +47,13 @@ var runPodCommand = cli.Command{
47
47
Name : "runp" ,
48
48
Usage : "Run a new pod" ,
49
49
ArgsUsage : "pod-config.[json|yaml]" ,
50
+ Flags : []cli.Flag {
51
+ cli.StringFlag {
52
+ Name : "runtime, r" ,
53
+ Usage : "Runtime handler to use. Available options are defined by the container runtime." ,
54
+ },
55
+ },
56
+
50
57
Action : func (context * cli.Context ) error {
51
58
sandboxSpec := context .Args ().First ()
52
59
if sandboxSpec == "" {
@@ -63,7 +70,7 @@ var runPodCommand = cli.Command{
63
70
}
64
71
65
72
// Test RuntimeServiceClient.RunPodSandbox
66
- err = RunPodSandbox (runtimeClient , podSandboxConfig )
73
+ err = RunPodSandbox (runtimeClient , podSandboxConfig , context . String ( "runtime" ) )
67
74
if err != nil {
68
75
return fmt .Errorf ("run pod sandbox failed: %v" , err )
69
76
}
@@ -236,8 +243,11 @@ var listPodCommand = cli.Command{
236
243
237
244
// RunPodSandbox sends a RunPodSandboxRequest to the server, and parses
238
245
// the returned RunPodSandboxResponse.
239
- func RunPodSandbox (client pb.RuntimeServiceClient , config * pb.PodSandboxConfig ) error {
240
- request := & pb.RunPodSandboxRequest {Config : config }
246
+ func RunPodSandbox (client pb.RuntimeServiceClient , config * pb.PodSandboxConfig , runtime string ) error {
247
+ request := & pb.RunPodSandboxRequest {
248
+ Config : config ,
249
+ RuntimeHandler : runtime ,
250
+ }
241
251
logrus .Debugf ("RunPodSandboxRequest: %v" , request )
242
252
r , err := client .RunPodSandbox (context .Background (), request )
243
253
logrus .Debugf ("RunPodSandboxResponse: %v" , r )
0 commit comments