Skip to content

Commit b520428

Browse files
author
Kazuyoshi Kato
committed
Fix CRIU
- process.Init#io could be nil - Make sure CreateTaskRequest#Options is not empty before unmarshaling Signed-off-by: Kazuyoshi Kato <[email protected]>
1 parent f201b78 commit b520428

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

pkg/process/init.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,11 +193,15 @@ func (p *Init) createCheckpointedState(r *CreateConfig, pidFile *pidFile) error
193193
ParentPath: r.ParentCheckpoint,
194194
},
195195
PidFile: pidFile.Path(),
196-
IO: p.io.IO(),
197196
NoPivot: p.NoPivotRoot,
198197
Detach: true,
199198
NoSubreaper: true,
200199
}
200+
201+
if p.io != nil {
202+
opts.IO = p.io.IO()
203+
}
204+
201205
p.initState = &createdCheckpointState{
202206
p: p,
203207
opts: opts,

runtime/v2/runc/container.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func NewContainer(ctx context.Context, platform stdio.Platform, r *task.CreateTa
4949
}
5050

5151
var opts options.Options
52-
if r.Options != nil {
52+
if r.Options != nil && r.Options.GetTypeUrl() != "" {
5353
v, err := typeurl.UnmarshalAny(r.Options)
5454
if err != nil {
5555
return nil, err

0 commit comments

Comments
 (0)