utilsk8s.io/utils/nsenter Index | Files

package nsenter

import "k8s.io/utils/nsenter"

Index

Constants

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

Types

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 (*NSEnter) AbsHostPath

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

AbsHostPath returns the absolute runnable path for a specified command

func (*NSEnter) Command

func (ne *NSEnter) Command(cmd string, args ...string) exec.Cmd

Command returns a command wrapped with nenter

func (*NSEnter) CommandContext

func (ne *NSEnter) CommandContext(ctx context.Context, cmd string, args ...string) exec.Cmd

CommandContext returns a CommandContext wrapped with nsenter

func (*NSEnter) Exec

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

Exec executes nsenter commands in hostProcMountNsPath mount namespace

func (*NSEnter) LookPath

func (ne *NSEnter) LookPath(file string) (string, error)

LookPath returns a LookPath wrapped with nsenter

func (*NSEnter) SupportsSystemd

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

SupportsSystemd checks whether command systemd-run exists

type Nsenter

type Nsenter = NSEnter

Nsenter is a type alias for backward compatibility

func NewNsenter

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

NewNsenter constructs a new instance of NSEnter

Source Files

nsenter_unsupported.go

Version
v0.0.0-20250604170112-4c0f3b243397 (latest)
Published
Jun 4, 2025
Platform
js/wasm
Imports
3 packages
Last checked
1 month ago

Tools for package owners.