kubernetesk8s.io/kubernetes/pkg/util/procfs Index | Files

package procfs

import "k8s.io/kubernetes/pkg/util/procfs"

Package procfs implements utility functions relating to the /proc mount.

Index

Functions

func PKill

func PKill(name string, sig syscall.Signal) error

PKill finds process(es) using a regular expression and send a specified signal to each process.

func PidOf

func PidOf(name string) ([]int, error)

PidOf finds process(es) with a specified name (regexp match) and return their pid(s).

Types

type FakeProcFS

type FakeProcFS struct{}

func (*FakeProcFS) GetFullContainerName

func (fakePfs *FakeProcFS) GetFullContainerName(pid int) (string, error)

GetFullContainerName gets the container name given the root process id of the container. E.g. if the devices cgroup for the container is stored in /sys/fs/cgroup/devices/docker/nginx, return docker/nginx. Assumes that the process is part of exactly one cgroup hierarchy.

type ProcFS

type ProcFS struct{}

ProcFS provides a helper for getting container name via pid.

func (*ProcFS) GetFullContainerName

func (pfs *ProcFS) GetFullContainerName(pid int) (string, error)

GetFullContainerName gets the container name given the root process id of the container. E.g. if the devices cgroup for the container is stored in /sys/fs/cgroup/devices/docker/nginx, return docker/nginx. Assumes that the process is part of exactly one cgroup hierarchy.

type ProcFSInterface

type ProcFSInterface interface {
	// GetFullContainerName gets the container name given the root process id of the container.
	GetFullContainerName(pid int) (string, error)
}

Source Files

doc.go procfs.go procfs_fake.go procfs_linux.go

Version
v1.33.0 (latest)
Published
Apr 23, 2025
Platform
linux/amd64
Imports
13 packages
Last checked
3 hours ago

Tools for package owners.