shell

package
v0.0.0-...-9f9e0ff Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: EPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultShell = "sh"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerShellDetector

type ContainerShellDetector interface {
	// Detect preferable shell inside container for current user id.
	// Create new info exec get information about preferable default shell.
	DetectShell(containerInfo *model.ContainerInfo) (shell string, err error)
}

ContainerShellDetector used to get information about preferable exec shell defined inside container for current active user. Information about preferable shell we get from /etc/passwd file and user Id.

type ExecInfoParser

type ExecInfoParser interface {
	// Parse default shell by user id from /etc/passwd file content.
	ParseShellFromEtcPassWd(etcPassWdContent string, userId string) (shell string, err error)
	// Parse user id inside container.
	ParseUID(content string) (uid string, err error)
}

Component to parse info exec output with information about default shell inside container.

func NewExecInfoParser

func NewExecInfoParser() ExecInfoParser

Create new info exec parser.

type ShellDetector

Component to detect shell inside container with help creation information execs.

func NewShellDetector

func NewShellDetector(k8sAPI *client.K8sAPI, namespace string) *ShellDetector

NewShellDetector create new shell detector inside container.

func (*ShellDetector) DetectShell

func (detector *ShellDetector) DetectShell(containerInfo *model.ContainerInfo) (shell string, err error)

Detect default shell inside container by container info.

Jump to

Keyboard shortcuts

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