kubernetesk8s.io/kubernetes/pkg/util/nsenter Index | Files

package nsenter

import "k8s.io/kubernetes/pkg/util/nsenter"

Index

Constants

const (
	// DefaultHostRootFsPath is path to host's filesystem mounted into container
	// with kubelet.
	DefaultHostRootFsPath = "/rootfs"
)

Types

type Executor

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

Executor wraps executor interface to be executed via nsenter

func NewNsenterExecutor

func NewNsenterExecutor(hostRootFsPath string, executor exec.Interface) *Executor

NewNsenterExecutor returns new nsenter based executor

func (*Executor) Command

func (nsExecutor *Executor) Command(cmd string, args ...string) exec.Cmd

Command returns a command wrapped with nenter

func (*Executor) CommandContext

func (nsExecutor *Executor) CommandContext(ctx context.Context, cmd string, args ...string) exec.Cmd

CommandContext returns a CommandContext wrapped with nsenter

func (*Executor) LookPath

func (nsExecutor *Executor) LookPath(file string) (string, error)

LookPath returns a LookPath wrapped with nsenter

type Nsenter

type Nsenter struct {
	// a map of commands to their paths on the host filesystem
	Paths map[string]string
}

Nsenter is part of experimental support for running the kubelet in a container.

func NewNsenter

func NewNsenter(hostRootFsPath string, executor exec.Interface) (*Nsenter, error)

NewNsenter constructs a new instance of Nsenter

func (*Nsenter) AbsHostPath

func (ne *Nsenter) AbsHostPath(command string) string

AbsHostPath returns the absolute runnable path for a specified command

func (*Nsenter) Exec

func (ne *Nsenter) Exec(cmd string, args []string) exec.Cmd

Exec executes nsenter commands in hostProcMountNsPath mount namespace

func (*Nsenter) SupportsSystemd

func (ne *Nsenter) SupportsSystemd() (string, bool)

SupportsSystemd checks whether command systemd-run exists

Source Files

exec_unsupported.go nsenter_unsupported.go

Version
v1.13.9
Published
Aug 1, 2019
Platform
js/wasm
Imports
3 packages
Last checked
1 minute ago

Tools for package owners.