- 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:
Kazuyoshi Kato 2020-11-11 21:37:39 -08:00
parent f201b78b90
commit b520428b5a
2 changed files with 6 additions and 2 deletions

View File

@ -193,11 +193,15 @@ func (p *Init) createCheckpointedState(r *CreateConfig, pidFile *pidFile) error
ParentPath: r.ParentCheckpoint,
},
PidFile: pidFile.Path(),
IO: p.io.IO(),
NoPivot: p.NoPivotRoot,
Detach: true,
NoSubreaper: true,
}
if p.io != nil {
opts.IO = p.io.IO()
}
p.initState = &createdCheckpointState{
p: p,
opts: opts,

View File

@ -49,7 +49,7 @@ func NewContainer(ctx context.Context, platform stdio.Platform, r *task.CreateTa
}
var opts options.Options
if r.Options != nil {
if r.Options != nil && r.Options.GetTypeUrl() != "" {
v, err := typeurl.UnmarshalAny(r.Options)
if err != nil {
return nil, err