Merge pull request #3280 from jterry75/init_state_resize_unused
Remove unused Resize method from initState
This commit is contained in:
commit
5158bc8de2
@ -324,13 +324,6 @@ func (p *Init) Resize(ws console.WinSize) error {
|
|||||||
return p.console.Resize(ws)
|
return p.console.Resize(ws)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *Init) resize(ws console.WinSize) error {
|
|
||||||
if p.console == nil {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
return p.console.Resize(ws)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Pause the init process and all its child processes
|
// Pause the init process and all its child processes
|
||||||
func (p *Init) Pause(ctx context.Context) error {
|
func (p *Init) Pause(ctx context.Context) error {
|
||||||
p.mu.Lock()
|
p.mu.Lock()
|
||||||
|
@ -21,7 +21,6 @@ package proc
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/containerd/console"
|
|
||||||
"github.com/containerd/containerd/runtime/proc"
|
"github.com/containerd/containerd/runtime/proc"
|
||||||
runc "github.com/containerd/go-runc"
|
runc "github.com/containerd/go-runc"
|
||||||
google_protobuf "github.com/gogo/protobuf/types"
|
google_protobuf "github.com/gogo/protobuf/types"
|
||||||
@ -30,7 +29,6 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type initState interface {
|
type initState interface {
|
||||||
Resize(console.WinSize) error
|
|
||||||
Start(context.Context) error
|
Start(context.Context) error
|
||||||
Delete(context.Context) error
|
Delete(context.Context) error
|
||||||
Pause(context.Context) error
|
Pause(context.Context) error
|
||||||
@ -76,10 +74,6 @@ func (s *createdState) Checkpoint(ctx context.Context, r *CheckpointConfig) erro
|
|||||||
return errors.Errorf("cannot checkpoint a task in created state")
|
return errors.Errorf("cannot checkpoint a task in created state")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *createdState) Resize(ws console.WinSize) error {
|
|
||||||
return s.p.resize(ws)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (s *createdState) Start(ctx context.Context) error {
|
func (s *createdState) Start(ctx context.Context) error {
|
||||||
if err := s.p.start(ctx); err != nil {
|
if err := s.p.start(ctx); err != nil {
|
||||||
return err
|
return err
|
||||||
@ -145,10 +139,6 @@ func (s *createdCheckpointState) Checkpoint(ctx context.Context, r *CheckpointCo
|
|||||||
return errors.Errorf("cannot checkpoint a task in created state")
|
return errors.Errorf("cannot checkpoint a task in created state")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *createdCheckpointState) Resize(ws console.WinSize) error {
|
|
||||||
return s.p.resize(ws)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (s *createdCheckpointState) Start(ctx context.Context) error {
|
func (s *createdCheckpointState) Start(ctx context.Context) error {
|
||||||
p := s.p
|
p := s.p
|
||||||
sio := p.stdio
|
sio := p.stdio
|
||||||
@ -255,10 +245,6 @@ func (s *runningState) Checkpoint(ctx context.Context, r *CheckpointConfig) erro
|
|||||||
return s.p.checkpoint(ctx, r)
|
return s.p.checkpoint(ctx, r)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *runningState) Resize(ws console.WinSize) error {
|
|
||||||
return s.p.resize(ws)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (s *runningState) Start(ctx context.Context) error {
|
func (s *runningState) Start(ctx context.Context) error {
|
||||||
return errors.Errorf("cannot start a running process")
|
return errors.Errorf("cannot start a running process")
|
||||||
}
|
}
|
||||||
@ -319,10 +305,6 @@ func (s *pausedState) Checkpoint(ctx context.Context, r *CheckpointConfig) error
|
|||||||
return s.p.checkpoint(ctx, r)
|
return s.p.checkpoint(ctx, r)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *pausedState) Resize(ws console.WinSize) error {
|
|
||||||
return s.p.resize(ws)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (s *pausedState) Start(ctx context.Context) error {
|
func (s *pausedState) Start(ctx context.Context) error {
|
||||||
return errors.Errorf("cannot start a paused process")
|
return errors.Errorf("cannot start a paused process")
|
||||||
}
|
}
|
||||||
@ -381,10 +363,6 @@ func (s *stoppedState) Checkpoint(ctx context.Context, r *CheckpointConfig) erro
|
|||||||
return errors.Errorf("cannot checkpoint a stopped container")
|
return errors.Errorf("cannot checkpoint a stopped container")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *stoppedState) Resize(ws console.WinSize) error {
|
|
||||||
return errors.Errorf("cannot resize a stopped container")
|
|
||||||
}
|
|
||||||
|
|
||||||
func (s *stoppedState) Start(ctx context.Context) error {
|
func (s *stoppedState) Start(ctx context.Context) error {
|
||||||
return errors.Errorf("cannot start a stopped process")
|
return errors.Errorf("cannot start a stopped process")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user