Skip to content

Commit

Permalink
runtime/shim: fix the nil checkpoint options
Browse files Browse the repository at this point in the history
Signed-off-by: Iceber Gu <wei.cai-nat@daocloud.io>
  • Loading branch information
Iceber committed Apr 14, 2023
1 parent c5a43b0 commit 18d7e84
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions runtime/v2/runc/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -470,13 +470,12 @@ func (c *Container) Checkpoint(ctx context.Context, r *task.CheckpointTaskReques
if err != nil {
return err
}
var opts *options.CheckpointOptions

var opts options.CheckpointOptions
if r.Options != nil {
v, err := typeurl.UnmarshalAny(r.Options)
if err != nil {
if err := typeurl.UnmarshalTo(r.Options, &opts); err != nil {
return err
}
opts = v.(*options.CheckpointOptions)
}
return p.(*process.Init).Checkpoint(ctx, &process.CheckpointConfig{
Path: r.Path,
Expand Down

0 comments on commit 18d7e84

Please sign in to comment.