executionexecutor

package
v0.0.52 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2026 License: Apache-2.0 Imports: 28 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package executionexecutor is the fixed, credential-free workload helper.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnableCommandExecution

func EnableCommandExecution() error

EnableCommandExecution makes this process a Linux child subreaper. It must be called by the dedicated executor helper before it starts any other process.

func ServerTLSConfig added in v0.0.52

func ServerTLSConfig(certDir, trustDir string) (*tls.Config, error)

ServerTLSConfig returns a mutual TLS configuration presenting the key pair in certDir and admitting only clients that chain to the CA bundle in trustDir and carry its client URI. The trust directory is reread for every handshake.

func SuperviseCommand added in v0.0.52

func SuperviseCommand(control io.Reader, status, stdout, stderr *os.File) error

SuperviseCommand is the per-command helper process. It reads a length-prefixed command from control, runs it with output on stdout and stderr, and stops it when control yields another byte or ends. It writes "started" and then "exit <code> <confirmed>" lines to status, or "noshell" when the shell is missing. The command can neither inherit status nor reopen it through /proc.

Types

type CommandSupervisor added in v0.0.52

type CommandSupervisor struct {
	// contains filtered or unexported fields
}

CommandSupervisor runs each command under its own helper process, a subreaper, so every process a command starts stays attributable to it while other commands run.

func NewCommandSupervisor added in v0.0.52

func NewCommandSupervisor(helper, env []string, dir string) *CommandSupervisor

NewCommandSupervisor runs helper, an argv whose process calls SuperviseCommand, with env in dir.

func (*CommandSupervisor) ReapOrphans added in v0.0.52

func (s *CommandSupervisor) ReapOrphans(ctx context.Context, interval time.Duration)

ReapOrphans kills and reaps, every interval until ctx ends, each child of this process that is not a helper. Orphans arrive here when a helper is killed and this process is a subreaper or PID 1.

func (*CommandSupervisor) Start added in v0.0.52

func (s *CommandSupervisor) Start(
	ctx context.Context, command string, stdout, stderr io.Writer,
) (commandserver.Process, error)

Start implements commandserver.Runner.

type Executor

type Executor struct {
	// contains filtered or unexported fields
}

Executor serves one credential-free workload-helper process.

func New

func New(root string, limits Limits) (*Executor, error)

New constructs an executor confined to root.

func (*Executor) Close

func (*Executor) Close() error

Close releases executor resources.

func (*Executor) Execute

Execute performs one bounded executor operation.

type Limits

type Limits struct {
	MaxFileBytes   int
	MaxEntries     int
	CommandTimeout time.Duration
}

Limits bounds one executor operation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL