utils

package
v1.1.19 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckNamespacesExists added in v1.1.10

func CheckNamespacesExists(namespaces []LinuxNamespaceWithInode, wantedTypes ...specs.LinuxNamespaceType) error

func CopyFileFromProcessToBundle

func CopyFileFromProcessToBundle(bundle string, pid int, path string) error

func IsUsingHostNetwork

func IsUsingHostNetwork(pid int) (bool, error)

IsUsingHostNetwork determines weather the given process has the same network as the init process.

func ReadCgroupPath

func ReadCgroupPath(pid int) (string, error)

func ResolveNamespacesUsingInode added in v1.1.10

func ResolveNamespacesUsingInode(namespaces []LinuxNamespaceWithInode) []specs.LinuxNamespace

func RootCommandContext

func RootCommandContext(ctx context.Context, name string, arg ...string) *exec.Cmd

func SidecarImagePath added in v1.1.1

func SidecarImagePath() string

Types

type KeyMutex added in v1.1.16

type KeyMutex interface {
	// Acquires a lock associated with the specified ID, creates the lock if one doesn't already exist.
	LockKey(id string)

	// Releases the lock associated with the specified ID.
	// Returns an error if the specified ID doesn't exist.
	UnlockKey(id string) error
}

KeyMutex is a thread-safe interface for acquiring locks on arbitrary strings.

func NewHashedKeyMutex added in v1.1.16

func NewHashedKeyMutex(n int) KeyMutex

NewHashedKeyMutex returns a new instance of KeyMutex which hashes arbitrary keys to a fixed set of locks. `n` specifies number of locks, if n <= 0, we use number of cpus. Note that because it uses fixed set of locks, different keys may share same lock, so it's possible to wait on same lock.

type LinuxNamespaceWithInode added in v1.1.10

type LinuxNamespaceWithInode struct {
	specs.LinuxNamespace
	Inode uint64
}

func ReadNamespaces

func ReadNamespaces(pid int) ([]LinuxNamespaceWithInode, error)

Jump to

Keyboard shortcuts

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