| 516 | } |
| 517 | |
| 518 | func (l *local) Exec(ctx context.Context, r *api.ExecProcessRequest, _ ...grpc.CallOption) (*ptypes.Empty, error) { |
| 519 | if r.ExecID == "" { |
| 520 | return nil, status.Errorf(codes.InvalidArgument, "exec id cannot be empty") |
| 521 | } |
| 522 | t, err := l.getTask(ctx, r.ContainerID) |
| 523 | if err != nil { |
| 524 | return nil, err |
| 525 | } |
| 526 | if _, err := t.Exec(ctx, r.ExecID, runtime.ExecOpts{ |
| 527 | Spec: r.Spec, |
| 528 | IO: runtime.IO{ |
| 529 | Stdin: r.Stdin, |
| 530 | Stdout: r.Stdout, |
| 531 | Stderr: r.Stderr, |
| 532 | Terminal: r.Terminal, |
| 533 | }, |
| 534 | }); err != nil { |
| 535 | return nil, errgrpc.ToGRPC(err) |
| 536 | } |
| 537 | return empty, nil |
| 538 | } |
| 539 | |
| 540 | func (l *local) ResizePty(ctx context.Context, r *api.ResizePtyRequest, _ ...grpc.CallOption) (*ptypes.Empty, error) { |
| 541 | t, err := l.getTask(ctx, r.ContainerID) |