Documentation ¶
Index ¶
- Variables
- func DetectCgroupPath() (string, error)
- func FileExists(filePath string) bool
- func FindChildProcesses(parentProcess *process.Process) ([]*process.Process, error)
- func FindChildProcessesUnderMinikubeWithDockerDriver(pid int) ([]*process.Process, error)
- func GetAllProcessFromContainer(containerStatus v1.ContainerStatus, nodeContainerRuntime string) ([]*process.Process, error)
- func GetContainerFileSystemRoot(containerID string, runtime string) (string, error)
- func GetContainerStatuses(targetPod v1.Pod) ([]v1.ContainerStatus, error)
- func GetDefaultKubeConfig() string
- func GetDockerContainerInfo(containerID string) (types.ContainerJSON, error)
- func GetNodeContainerRuntime(kubeconfig string, nodeName string) (string, string, error)
- func GetNodeName() (string, error)
- func GetPidUnderRootPidNamespace(ppid, pid int) (int, error)
- func GetPodNameFromNodeAndLabel(kubeconfig string, namespace string, nodeName string, labelSelector string) (string, error)
- func GetSidecarBinaryPath(containerID string, runtime string) (string, error)
- func HostToNetLong(i uint32) uint32
- func HostToNetShort(i uint16) uint16
- func IpToUint32(ipAddr string) (uint32, error)
- func IsInMinikubeMode() bool
- func LocateTargetPod(kubeconfig string, podName string, namespace string) (*v1.Pod, error)
- func NetToHostLong(i uint32) uint32
- func NetToHostShort(i uint16) uint16
- type Ipv4Address
- type Ipv6Address
- type Mac
- type UnifiedAddress
Constants ¶
This section is empty.
Variables ¶
var MinikubePid = -1
Functions ¶
func DetectCgroupPath ¶
DetectCgroupPath returns the first-found mount point of type cgroup2
func FindChildProcesses ¶
FindChildProcesses finds child process(es) from a parent process. Return nil for empty
func GetAllProcessFromContainer ¶
func GetAllProcessFromContainer(containerStatus v1.ContainerStatus, nodeContainerRuntime string) ([]*process.Process, error)
GetAllProcessFromContainer get all processes from one container
func GetContainerFileSystemRoot ¶
GetContainerFileSystemRoot get root path on the local machine file system
func GetContainerStatuses ¶
func GetContainerStatuses(targetPod v1.Pod) ([]v1.ContainerStatus, error)
GetContainerStatuses gets all container statuses from pod object
func GetDefaultKubeConfig ¶
func GetDefaultKubeConfig() string
GetDefaultKubeConfig gets default kubeconfig file path
func GetDockerContainerInfo ¶
func GetDockerContainerInfo(containerID string) (types.ContainerJSON, error)
func GetNodeContainerRuntime ¶
GetNodeContainerRuntime gets container runtime version
func GetNodeName ¶
GetNodeName gets local machine's hostname, aka node name
func GetPodNameFromNodeAndLabel ¶
func GetPodNameFromNodeAndLabel(kubeconfig string, namespace string, nodeName string, labelSelector string) (string, error)
GetPodNameFromNodeAndLabel finds target pod by node name and label
func GetSidecarBinaryPath ¶
func HostToNetLong ¶
HostToNetLong converts a 32-bit integer from host to network byte order, aka "htonl"
func HostToNetShort ¶
HostToNetShort converts a 16-bit integer from host to network byte order, aka "htons"
func IpToUint32 ¶
IpToUint32 converts IP in string (e.g. 127.0.0.1) to int (e.g. 0x100007f)
func IsInMinikubeMode ¶
func IsInMinikubeMode() bool
IsInMinikubeMode returns ture if running on minikube
func LocateTargetPod ¶
LocateTargetPod finds target pod by name and namespace
func NetToHostLong ¶
NetToHostLong converts a 32-bit integer from network to host byte order, aka "ntohl"
func NetToHostShort ¶
NetToHostShort converts a 16-bit integer from network to host byte order, aka "ntohs"
Types ¶
type Ipv4Address ¶
type Ipv4Address uint32
func (Ipv4Address) ToString ¶
func (ip Ipv4Address) ToString() string
type Ipv6Address ¶
type Ipv6Address uint128
func (Ipv6Address) ToString ¶
func (ip Ipv6Address) ToString() string
type UnifiedAddress ¶
func (UnifiedAddress) ToString ¶
func (ip UnifiedAddress) ToString(version int) string
ToString converts binary UnifiedAddress by provided IP version