crclient

package
v0.0.0-...-a8f7ac2 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DevNull          = " 2>/dev/null"
	DockerInspectPID = "chroot /host docker inspect -f '{{.State.Pid}}' "
)
View Source
const PsRegex = `(?m)^(\d+?)\s+?(\d+?)\s+?(\d+?)\s+?(.*?)$`

Variables

This section is empty.

Functions

func ExecCommandContainerNSEnter

func ExecCommandContainerNSEnter(command string,
	aContainer *provider.Container) (outStr, errStr string, err error)

ExecCommandContainerNSEnter executes a command in the specified container namespace using nsenter

func GetContainerPidNamespace

func GetContainerPidNamespace(testContainer *provider.Container, env *provider.TestEnvironment) (string, error)

To get the pid namespace of the container

func GetNodeProbePodContext

func GetNodeProbePodContext(node string, env *provider.TestEnvironment) (clientsholder.Context, error)

Helper function to create the clientsholder.Context of the first container of the probe pod that runs in the give node. This context is usually needed to run shell commands that get information from a node where a pod/container under test is running.

func GetPidFromContainer

func GetPidFromContainer(cut *provider.Container, ctx clientsholder.Context) (int, error)

Types

type Process

type Process struct {
	PidNs, Pid, PPid int
	Args             string
}

func GetContainerProcesses

func GetContainerProcesses(container *provider.Container, env *provider.TestEnvironment) ([]*Process, error)

func GetPidsFromPidNamespace

func GetPidsFromPidNamespace(pidNamespace string, container *provider.Container) (p []*Process, err error)

func (*Process) String

func (p *Process) String() string

Jump to

Keyboard shortcuts

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