runcontainerd

package
v0.0.0-...-8deac7e Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BackingProcess

type BackingProcess interface {
	ID() string
	Signal(syscall.Signal) error
	Wait() (int, error)
	Delete() error
}

type BndlLoader

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

func NewBndlLoader

func NewBndlLoader(containerManager ContainerManager) BndlLoader

func (BndlLoader) Load

func (b BndlLoader) Load(log lager.Logger, handle string) (goci.Bndl, error)

type CgroupManager

type CgroupManager interface {
	SetUseMemoryHierarchy(handle string) error
}

func NewCgroupManager

func NewCgroupManager(runcRoot, namespace string) CgroupManager

type ContainerFilter

type ContainerFilter struct {
	Label        string
	Value        string
	ComparisonOp string
}

type ContainerManager

type ContainerManager interface {
	Create(log lager.Logger, containerID string, spec *specs.Spec, containerRootUID, containerRootGID uint32, processIO func() (io.Reader, io.Writer, io.Writer)) error
	Delete(log lager.Logger, containerID string) error
	Exec(log lager.Logger, containerID, processID string, spec *specs.Process, processIO func() (io.Reader, io.Writer, io.Writer, bool)) (BackingProcess, error)
	State(log lager.Logger, containerID string) (int, string, error)
	GetContainerPID(log lager.Logger, containerID string) (uint32, error)
	OOMEvents(log lager.Logger) <-chan *apievents.TaskOOM
	Spec(log lager.Logger, containerID string) (*specs.Spec, error)
	BundleIDs(filterLabels ...ContainerFilter) ([]string, error)
	RemoveBundle(lager.Logger, string) error
}

type ContainerNotFoundError

type ContainerNotFoundError struct {
	Handle string
}

func (ContainerNotFoundError) Error

func (ce ContainerNotFoundError) Error() string

type Execer

type Execer interface {
	ExecWithBndl(log lager.Logger, id string, bndl goci.Bndl, spec garden.ProcessSpec, io garden.ProcessIO) (garden.Process, error)
	Attach(log lager.Logger, id string, processId string, io garden.ProcessIO) (garden.Process, error)
}

type Mkdirer

type Mkdirer interface {
	MkdirAs(rootFSPathFile string, uid, gid int, mode os.FileMode, recreate bool, path ...string) error
}

type NerdDeleter

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

func NewDeleter

func NewDeleter(runtime Runtime) *NerdDeleter

func (*NerdDeleter) Delete

func (d *NerdDeleter) Delete(log lager.Logger, handle string, _ bool) error

type PeaHandlesGetter

type PeaHandlesGetter interface {
	ContainerPeaHandles(log lager.Logger, sandboxHandle string) ([]string, error)
}

type PeaManager

type PeaManager interface {
	Create(log lager.Logger, id string, bundle goci.Bndl, io garden.ProcessIO) error
	Delete(log lager.Logger, containerID string) error
	RemoveBundle(log lager.Logger, containerID string) error
}

type PeaProcess

type PeaProcess struct {
	Process
	// contains filtered or unexported fields
}

func NewPeaProcess

func NewPeaProcess(log lager.Logger, process Process, peaManager PeaManager, volumizer Volumizer) *PeaProcess

func (*PeaProcess) Wait

func (p *PeaProcess) Wait() (int, error)

type PidGetter

type PidGetter struct {
	Nerd ContainerManager
}

func (*PidGetter) GetPeaPid

func (p *PidGetter) GetPeaPid(logger lager.Logger, _, peaID string) (int, error)

func (*PidGetter) GetPid

func (p *PidGetter) GetPid(logger lager.Logger, containerID string) (int, error)

type Process

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

func NewProcess

func NewProcess(log lager.Logger, nerdProcess BackingProcess, cleanupProcessDirsOnWait bool) *Process

func (*Process) ID

func (p *Process) ID() string

func (*Process) SetTTY

func (p *Process) SetTTY(garden.TTYSpec) error

func (*Process) Signal

func (p *Process) Signal(gardenSignal garden.Signal) error

func (*Process) Wait

func (p *Process) Wait() (int, error)

type ProcessBuilder

type ProcessBuilder interface {
	BuildProcess(bndl goci.Bndl, spec garden.ProcessSpec, user *users.ExecUser) *specs.Process
}

type ProcessManager

type ProcessManager interface {
	GetProcess(log lager.Logger, containerID, processID string) (BackingProcess, error)
	GetTask(log lager.Logger, id string) (BackingProcess, error)
}

type ProcessNotFoundError

type ProcessNotFoundError struct {
	Handle string
	ID     string
}

func (ProcessNotFoundError) Error

func (pe ProcessNotFoundError) Error() string

type RunContainerPea

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

func NewRunContainerPea

func NewRunContainerPea(peaManager PeaManager, processManager ProcessManager, volumizer Volumizer, cleanupProcessDirsOnWait bool) *RunContainerPea

func (*RunContainerPea) RunPea

func (r *RunContainerPea) RunPea(
	log lager.Logger, processID string, processBundle goci.Bndl, sandboxHandle string,
	pio garden.ProcessIO, tty bool, procJSON io.Reader, extraCleanup func() error,
) (garden.Process, error)

type RunContainerd

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

func New

func New(containerManager ContainerManager,
	processManager ProcessManager,
	processBuilder ProcessBuilder,
	userLookupper users.UserLookupper,
	execer Execer,
	statser Statser,
	useContainerdForProcesses bool,
	cgroupManager CgroupManager,
	mkdirer Mkdirer,
	peaHandlesGetter PeaHandlesGetter,
	cleanupProcessDirsOnWait bool,
	runtimeStopper RuntimeStopper) *RunContainerd

func (*RunContainerd) Attach

func (r *RunContainerd) Attach(log lager.Logger, sandboxID, processID string, io garden.ProcessIO) (garden.Process, error)

func (*RunContainerd) BundleInfo

func (r *RunContainerd) BundleInfo(log lager.Logger, handle string) (string, goci.Bndl, error)

func (*RunContainerd) ContainerHandles

func (r *RunContainerd) ContainerHandles() ([]string, error)

func (*RunContainerd) ContainerPeaHandles

func (r *RunContainerd) ContainerPeaHandles(log lager.Logger, sandboxHandle string) ([]string, error)

func (*RunContainerd) Create

func (r *RunContainerd) Create(log lager.Logger, id string, bundle goci.Bndl, pio garden.ProcessIO) error

func (*RunContainerd) Delete

func (r *RunContainerd) Delete(log lager.Logger, id string) error

func (*RunContainerd) Events

func (r *RunContainerd) Events(log lager.Logger) (<-chan event.Event, error)

func (*RunContainerd) Exec

func (r *RunContainerd) Exec(log lager.Logger, containerID string, gardenProcessSpec garden.ProcessSpec, gardenIO garden.ProcessIO) (garden.Process, error)

func (*RunContainerd) RemoveBundle

func (r *RunContainerd) RemoveBundle(log lager.Logger, handle string) error

func (*RunContainerd) State

func (r *RunContainerd) State(log lager.Logger, id string) (rundmc.State, error)

func (*RunContainerd) Stats

func (*RunContainerd) Stop

func (r *RunContainerd) Stop() error

type Runtime

type Runtime interface {
	Delete(log lager.Logger, id string) error
	RemoveBundle(log lager.Logger, id string) error
}

type RuntimeStopper

type RuntimeStopper interface {
	Stop() error
}

type Statser

type Statser interface {
	Stats(log lager.Logger, id string) (gardener.StatsContainerMetrics, error)
}

type TaskNotFoundError

type TaskNotFoundError struct {
	Handle string
}

func (TaskNotFoundError) Error

func (te TaskNotFoundError) Error() string

type Volumizer

type Volumizer interface {
	Destroy(log lager.Logger, handle string) error
}

Directories

Path Synopsis
nerdfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
privcheckerfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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