diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-03-11 21:04:02 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-03-11 21:04:02 +0900 |
| commit | 5c540f90aa5ac069a370cbef0ddd81fa268b43c5 (patch) | |
| tree | a57f2347c1c797b649248068aa00b4b6a28ddc43 /internal/outcome/spcontainer.go | |
| parent | 1e8ac5f68ef6911c278b4c48722a1924d996206c (diff) | |
internal/outcome: improve doc comments
This improves readability on smaller displays.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/outcome/spcontainer.go')
| -rw-r--r-- | internal/outcome/spcontainer.go | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/internal/outcome/spcontainer.go b/internal/outcome/spcontainer.go index 768e6bc5..2d6bb78b 100644 --- a/internal/outcome/spcontainer.go +++ b/internal/outcome/spcontainer.go @@ -27,7 +27,9 @@ const varRunNscd = fhs.Var + "run/nscd" func init() { gob.Register(new(spParamsOp)) } -// spParamsOp initialises unordered fields of [container.Params] and the optional root filesystem. +// spParamsOp initialises unordered fields of [container.Params] and the +// optional root filesystem. +// // This outcomeOp is hardcoded to always run first. type spParamsOp struct { // Value of $TERM, stored during toSystem. @@ -67,8 +69,8 @@ func (s *spParamsOp) toContainer(state *outcomeStateParams) error { state.params.Args = state.Container.Args } - // the container is canceled when shim is requested to exit or receives an interrupt or termination signal; - // this behaviour is implemented in the shim + // The container is cancelled when shim is requested to exit or receives an + // interrupt or termination signal. This behaviour is implemented in the shim. state.params.ForwardCancel = state.Shim.WaitDelay > 0 if state.Container.Flags&hst.FMultiarch != 0 { @@ -115,7 +117,8 @@ func (s *spParamsOp) toContainer(state *outcomeStateParams) error { } else { state.params.Bind(fhs.AbsDev, fhs.AbsDev, std.BindWritable|std.BindDevice) } - // /dev is mounted readonly later on, this prevents /dev/shm from going readonly with it + // /dev is mounted readonly later on, this prevents /dev/shm from going + // readonly with it state.params.Tmpfs(fhs.AbsDevShm, 0, 01777) return nil @@ -123,7 +126,9 @@ func (s *spParamsOp) toContainer(state *outcomeStateParams) error { func init() { gob.Register(new(spFilesystemOp)) } -// spFilesystemOp applies configured filesystems to [container.Params], excluding the optional root filesystem. +// spFilesystemOp applies configured filesystems to [container.Params], +// excluding the optional root filesystem. +// // This outcomeOp is hardcoded to always run last. type spFilesystemOp struct { // Matched paths to cover. Stored during toSystem. @@ -297,8 +302,8 @@ func (s *spFilesystemOp) toContainer(state *outcomeStateParams) error { return nil } -// resolveRoot handles the root filesystem special case for [hst.FilesystemConfig] and additionally resolves autoroot -// as it requires special handling during path hiding. +// resolveRoot handles the root filesystem special case for [hst.FilesystemConfig] +// and additionally resolves autoroot as it requires special handling during path hiding. func resolveRoot(c *hst.ContainerConfig) (rootfs hst.FilesystemConfig, filesystem []hst.FilesystemConfigJSON, autoroot *hst.FSBind) { // root filesystem special case filesystem = c.Filesystem @@ -316,7 +321,8 @@ func resolveRoot(c *hst.ContainerConfig) (rootfs hst.FilesystemConfig, filesyste return } -// evalSymlinks calls syscallDispatcher.evalSymlinks but discards errors unwrapping to [fs.ErrNotExist]. +// evalSymlinks calls syscallDispatcher.evalSymlinks but discards errors +// unwrapping to [fs.ErrNotExist]. func evalSymlinks(msg message.Msg, k syscallDispatcher, v *string) error { if p, err := k.evalSymlinks(*v); err != nil { if !errors.Is(err, fs.ErrNotExist) { |
