99
1010 "github.com/containerd/console"
1111 "github.com/containerd/containerd/errdefs"
12- shimapi "github.com/containerd/containerd/linux/shim/v1"
1312 "github.com/containerd/fifo"
1413 runc "github.com/containerd/go-runc"
14+ google_protobuf "github.com/gogo/protobuf/types"
1515 "github.com/pkg/errors"
1616)
1717
@@ -20,8 +20,8 @@ type initState interface {
2020
2121 Pause (context.Context ) error
2222 Resume (context.Context ) error
23- Update (context.Context , * shimapi. UpdateTaskRequest ) error
24- Checkpoint (context.Context , * shimapi. CheckpointTaskRequest ) error
23+ Update (context.Context , * google_protobuf. Any ) error
24+ Checkpoint (context.Context , * CheckpointConfig ) error
2525}
2626
2727type createdState struct {
@@ -56,14 +56,14 @@ func (s *createdState) Resume(ctx context.Context) error {
5656 return errors .Errorf ("cannot resume task in created state" )
5757}
5858
59- func (s * createdState ) Update (context context.Context , r * shimapi. UpdateTaskRequest ) error {
59+ func (s * createdState ) Update (context context.Context , r * google_protobuf. Any ) error {
6060 s .p .mu .Lock ()
6161 defer s .p .mu .Unlock ()
6262
6363 return s .p .update (context , r )
6464}
6565
66- func (s * createdState ) Checkpoint (context context.Context , r * shimapi. CheckpointTaskRequest ) error {
66+ func (s * createdState ) Checkpoint (context context.Context , r * CheckpointConfig ) error {
6767 s .p .mu .Lock ()
6868 defer s .p .mu .Unlock ()
6969
@@ -146,14 +146,14 @@ func (s *createdCheckpointState) Resume(ctx context.Context) error {
146146 return errors .Errorf ("cannot resume task in created state" )
147147}
148148
149- func (s * createdCheckpointState ) Update (context context.Context , r * shimapi. UpdateTaskRequest ) error {
149+ func (s * createdCheckpointState ) Update (context context.Context , r * google_protobuf. Any ) error {
150150 s .p .mu .Lock ()
151151 defer s .p .mu .Unlock ()
152152
153153 return s .p .update (context , r )
154154}
155155
156- func (s * createdCheckpointState ) Checkpoint (context context.Context , r * shimapi. CheckpointTaskRequest ) error {
156+ func (s * createdCheckpointState ) Checkpoint (context context.Context , r * CheckpointConfig ) error {
157157 s .p .mu .Lock ()
158158 defer s .p .mu .Unlock ()
159159
@@ -259,14 +259,14 @@ func (s *runningState) Resume(ctx context.Context) error {
259259 return errors .Errorf ("cannot resume a running process" )
260260}
261261
262- func (s * runningState ) Update (context context.Context , r * shimapi. UpdateTaskRequest ) error {
262+ func (s * runningState ) Update (context context.Context , r * google_protobuf. Any ) error {
263263 s .p .mu .Lock ()
264264 defer s .p .mu .Unlock ()
265265
266266 return s .p .update (context , r )
267267}
268268
269- func (s * runningState ) Checkpoint (ctx context.Context , r * shimapi. CheckpointTaskRequest ) error {
269+ func (s * runningState ) Checkpoint (ctx context.Context , r * CheckpointConfig ) error {
270270 s .p .mu .Lock ()
271271 defer s .p .mu .Unlock ()
272272
@@ -345,14 +345,14 @@ func (s *pausedState) Resume(ctx context.Context) error {
345345 return s .transition ("running" )
346346}
347347
348- func (s * pausedState ) Update (context context.Context , r * shimapi. UpdateTaskRequest ) error {
348+ func (s * pausedState ) Update (context context.Context , r * google_protobuf. Any ) error {
349349 s .p .mu .Lock ()
350350 defer s .p .mu .Unlock ()
351351
352352 return s .p .update (context , r )
353353}
354354
355- func (s * pausedState ) Checkpoint (ctx context.Context , r * shimapi. CheckpointTaskRequest ) error {
355+ func (s * pausedState ) Checkpoint (ctx context.Context , r * CheckpointConfig ) error {
356356 s .p .mu .Lock ()
357357 defer s .p .mu .Unlock ()
358358
@@ -427,14 +427,14 @@ func (s *stoppedState) Resume(ctx context.Context) error {
427427 return errors .Errorf ("cannot resume a stopped container" )
428428}
429429
430- func (s * stoppedState ) Update (context context.Context , r * shimapi. UpdateTaskRequest ) error {
430+ func (s * stoppedState ) Update (context context.Context , r * google_protobuf. Any ) error {
431431 s .p .mu .Lock ()
432432 defer s .p .mu .Unlock ()
433433
434434 return errors .Errorf ("cannot update a stopped container" )
435435}
436436
437- func (s * stoppedState ) Checkpoint (ctx context.Context , r * shimapi. CheckpointTaskRequest ) error {
437+ func (s * stoppedState ) Checkpoint (ctx context.Context , r * CheckpointConfig ) error {
438438 s .p .mu .Lock ()
439439 defer s .p .mu .Unlock ()
440440
0 commit comments