From 9e48d7f5626aa966a23754534f3120855d6a7c32 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Tue, 7 Oct 2025 01:50:56 +0900 Subject: hst/config: move container fields from toplevel This change also moves pd behaviour to cmd/hakurei, as this does not belong in the hst API. Signed-off-by: Ophestra --- internal/app/spcontainer.go | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'internal/app/spcontainer.go') diff --git a/internal/app/spcontainer.go b/internal/app/spcontainer.go index cb5d938f..4381fd72 100644 --- a/internal/app/spcontainer.go +++ b/internal/app/spcontainer.go @@ -18,11 +18,6 @@ const varRunNscd = container.FHSVar + "run/nscd" // spParamsOp initialises unordered fields of [container.Params] and the optional root filesystem. // This outcomeOp is hardcoded to always run first. type spParamsOp struct { - // Copied from the [hst.Config] field of the same name. - Path *container.Absolute `json:"path,omitempty"` - // Copied from the [hst.Config] field of the same name. - Args []string `json:"args"` - // Value of $TERM, stored during toSystem. Term string // Whether $TERM is set, stored during toSystem. @@ -49,15 +44,15 @@ func (s *spParamsOp) toContainer(state *outcomeStateParams) error { state.params.HostNet = state.Container.HostNet state.params.HostAbstract = state.Container.HostAbstract - if s.Path == nil { + if state.Container.Path == nil { return newWithMessage("invalid program path") } - state.params.Path = s.Path + state.params.Path = state.Container.Path - if len(s.Args) == 0 { - state.params.Args = []string{s.Path.String()} + if len(state.Container.Args) == 0 { + state.params.Args = []string{state.Container.Path.String()} } else { - state.params.Args = s.Args + state.params.Args = state.Container.Args } // the container is canceled when shim is requested to exit or receives an interrupt or termination signal; -- cgit v1.3.1