aboutsummaryrefslogtreecommitdiffhomepage
path: root/container/container.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-07-25 00:43:22 +0900
committerOphestra <cat@gensokyo.uk>2025-07-25 00:45:10 +0900
commite71ae3b8c5b4a8f103a078783fef2f56ee5450a2 (patch)
treee6b7a87006563da8c360ca248e261a7fe7e2820f /container/container.go
parent9d7a19d162e7003ce89804f00c526b77b2328baa (diff)
container: remove custom cmd initialisation
This part of the interface is very unintuitive and only used for testing, even in testing it is inelegant and can be done better. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'container/container.go')
-rw-r--r--container/container.go12
1 files changed, 2 insertions, 10 deletions
diff --git a/container/container.go b/container/container.go
index ecfb94cc..a10e610f 100644
--- a/container/container.go
+++ b/container/container.go
@@ -35,9 +35,6 @@ type (
// with behaviour identical to its [exec.Cmd] counterpart.
ExtraFiles []*os.File
- // Custom [exec.Cmd] initialisation function.
- CommandContext func(ctx context.Context) (cmd *exec.Cmd)
-
// param encoder for shim and init
setup *gob.Encoder
// cancels cmd
@@ -122,13 +119,8 @@ func (p *Container) Start() error {
p.SeccompPresets |= seccomp.PresetDenyTTY
}
- if p.CommandContext != nil {
- p.cmd = p.CommandContext(ctx)
- } else {
- p.cmd = exec.CommandContext(ctx, MustExecutable())
- p.cmd.Args = []string{"init"}
- }
-
+ p.cmd = exec.CommandContext(ctx, MustExecutable())
+ p.cmd.Args = []string{"init"}
p.cmd.Stdin, p.cmd.Stdout, p.cmd.Stderr = p.Stdin, p.Stdout, p.Stderr
p.cmd.WaitDelay = p.WaitDelay
if p.Cancel != nil {