aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-03-16 00:32:36 +0900
committerOphestra <cat@gensokyo.uk>2025-03-16 00:32:36 +0900
commit9f5dad1998d82346e2ead345e11791ed114e32e0 (patch)
tree184c621b13f1c1151af6991289c26c466e5df66f /internal
parent6e7ddb2d2ec6b163dc2c178bc4d73b5943f51206 (diff)
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>
Diffstat (limited to 'internal')
-rw-r--r--internal/sandbox/container.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/internal/sandbox/container.go b/internal/sandbox/container.go
index 6676a2a9..fff1d9d8 100644
--- a/internal/sandbox/container.go
+++ b/internal/sandbox/container.go
@@ -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