| 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) |
| 542 | if err != nil { |
| 543 | return nil, err |
| 544 | } |
| 545 | p := runtime.Process(t) |
| 546 | if r.ExecID != "" { |
| 547 | if p, err = t.Process(ctx, r.ExecID); err != nil { |
| 548 | return nil, errgrpc.ToGRPC(err) |
| 549 | } |
| 550 | } |
| 551 | if err := p.ResizePty(ctx, runtime.ConsoleSize{ |
| 552 | Width: r.Width, |
| 553 | Height: r.Height, |
| 554 | }); err != nil { |
| 555 | return nil, errgrpc.ToGRPC(err) |
| 556 | } |
| 557 | return empty, nil |
| 558 | } |
| 559 | |
| 560 | func (l *local) CloseIO(ctx context.Context, r *api.CloseIORequest, _ ...grpc.CallOption) (*ptypes.Empty, error) { |
| 561 | t, err := l.getTask(ctx, r.ContainerID) |