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:
2025-03-16 00:32:36 +09:00
parent 6e7ddb2d2e
commit 9f5dad1998

View File

@@ -114,6 +114,9 @@ func (p *Container) Start() error {
if p.cmd != nil {
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)
p.cancel = cancel