mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-04 02:56:18 +00:00
containerd-shim-kata-v2: add the service ResizePty support
Add the ResizePty api support to resize the console. Signed-off-by: ZeroMagic <anthonyliu@zju.edu.cn>
This commit is contained in:
parent
47326f566c
commit
cd321a3e6e
@ -423,7 +423,32 @@ func (s *service) Exec(ctx context.Context, r *taskAPI.ExecProcessRequest) (*pty
|
||||
|
||||
// ResizePty of a process
|
||||
func (s *service) ResizePty(ctx context.Context, r *taskAPI.ResizePtyRequest) (*ptypes.Empty, error) {
|
||||
return nil, errdefs.ErrNotImplemented
|
||||
s.Lock()
|
||||
defer s.Unlock()
|
||||
|
||||
c, err := s.getContainer(r.ID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
processID := c.id
|
||||
if r.ExecID != "" {
|
||||
execs, err := c.getExec(r.ExecID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
execs.tty.height = r.Height
|
||||
execs.tty.width = r.Width
|
||||
|
||||
processID = execs.id
|
||||
|
||||
}
|
||||
err = s.sandbox.WinsizeProcess(c.id, processID, r.Height, r.Width)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return empty, err
|
||||
}
|
||||
|
||||
// State returns runtime state information for a process
|
||||
|
Loading…
Reference in New Issue
Block a user