sandbox: return on zero length ops
This dodges potentially confusing behaviour where init fails due to Ops being clobbered during transfer. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
parent
6e7ddb2d2e
commit
9f5dad1998
@ -114,6 +114,9 @@ func (p *Container) Start() error {
|
|||||||
if p.cmd != nil {
|
if p.cmd != nil {
|
||||||
return errors.New("sandbox: already started")
|
return errors.New("sandbox: already started")
|
||||||
}
|
}
|
||||||
|
if p.Ops == nil || len(*p.Ops) == 0 {
|
||||||
|
return errors.New("sandbox: starting an empty container")
|
||||||
|
}
|
||||||
|
|
||||||
c, cancel := context.WithCancel(p.ctx)
|
c, cancel := context.WithCancel(p.ctx)
|
||||||
p.cancel = cancel
|
p.cancel = cancel
|
||||||
|
Loading…
Reference in New Issue
Block a user