Fix CRIU
- process.Init#io could be nil - Make sure CreateTaskRequest#Options is not empty before unmarshaling Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
This commit is contained in:
parent
f201b78b90
commit
b520428b5a
@ -193,11 +193,15 @@ func (p *Init) createCheckpointedState(r *CreateConfig, pidFile *pidFile) error
|
|||||||
ParentPath: r.ParentCheckpoint,
|
ParentPath: r.ParentCheckpoint,
|
||||||
},
|
},
|
||||||
PidFile: pidFile.Path(),
|
PidFile: pidFile.Path(),
|
||||||
IO: p.io.IO(),
|
|
||||||
NoPivot: p.NoPivotRoot,
|
NoPivot: p.NoPivotRoot,
|
||||||
Detach: true,
|
Detach: true,
|
||||||
NoSubreaper: true,
|
NoSubreaper: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if p.io != nil {
|
||||||
|
opts.IO = p.io.IO()
|
||||||
|
}
|
||||||
|
|
||||||
p.initState = &createdCheckpointState{
|
p.initState = &createdCheckpointState{
|
||||||
p: p,
|
p: p,
|
||||||
opts: opts,
|
opts: opts,
|
||||||
|
@ -49,7 +49,7 @@ func NewContainer(ctx context.Context, platform stdio.Platform, r *task.CreateTa
|
|||||||
}
|
}
|
||||||
|
|
||||||
var opts options.Options
|
var opts options.Options
|
||||||
if r.Options != nil {
|
if r.Options != nil && r.Options.GetTypeUrl() != "" {
|
||||||
v, err := typeurl.UnmarshalAny(r.Options)
|
v, err := typeurl.UnmarshalAny(r.Options)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
Loading…
Reference in New Issue
Block a user