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.
type ShellDetector ¶
type ShellDetector struct { ContainerShellDetector exec_info.InfoExecCreator ExecInfoParser }
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.
Click to show internal directories.
Click to hide internal directories.