Merge pull request #735 from crosbymichael/socket-unpack
Only set socket on non-nil type creation
This commit is contained in:
commit
07b5bca43c
@ -60,11 +60,12 @@ func newExecProcess(context context.Context, path string, r *shimapi.ExecRequest
|
||||
}
|
||||
opts := &runc.ExecOpts{
|
||||
PidFile: pidfile,
|
||||
ConsoleSocket: socket,
|
||||
IO: io,
|
||||
Detach: true,
|
||||
}
|
||||
|
||||
if socket != nil {
|
||||
opts.ConsoleSocket = socket
|
||||
}
|
||||
// process exec request
|
||||
var spec specs.Process
|
||||
if err := json.Unmarshal(r.Spec.Value, &spec); err != nil {
|
||||
|
@ -74,10 +74,12 @@ func newInitProcess(context context.Context, path string, r *shimapi.CreateReque
|
||||
}
|
||||
opts := &runc.CreateOpts{
|
||||
PidFile: filepath.Join(path, "init.pid"),
|
||||
ConsoleSocket: socket,
|
||||
IO: io,
|
||||
NoPivot: r.NoPivot,
|
||||
}
|
||||
if socket != nil {
|
||||
opts.ConsoleSocket = socket
|
||||
}
|
||||
if err := p.runc.Create(context, r.ID, r.Bundle, opts); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user