host

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: Apache-2.0 Imports: 18 Imported by: 3

Documentation

Overview

Package host provides ways to access the host filesystem.

Inspektor Gadget can run either in the host or in a container. When running in a container, the host filesystem must be available in a specific directory.

Package host provides ways to access the host filesystem.

Inspektor Gadget can run either in the host or in a container. When running in a container, the host filesystem must be available in a specific directory.

Package host provides ways to access the host filesystem.

Inspektor Gadget can run either in the host or in a container. When running in a container, the host filesystem must be available in a specific directory.

Index

Constants

This section is empty.

Variables

View Source
var (
	HostRoot   string
	HostProcFs string
)

Functions

func AddFlags added in v0.19.0

func AddFlags(command *cobra.Command)

AddFlags adds CLI flags for various workarounds

func GetProcCmdline

func GetProcCmdline(pid int) []string

func GetProcComm

func GetProcComm(pid int) string

func Init added in v0.19.0

func Init(config Config) error

func IsHostNetNs added in v0.18.0

func IsHostNetNs() (bool, error)

IsHostNetNs returns true if the current process is running in the host network namespace

func IsHostPidNs added in v0.18.0

func IsHostPidNs() (bool, error)

IsHostPidNs returns true if the current process is running in the host PID namespace

Types

type Config added in v0.19.0

type Config struct {
	// AutoMountFilesystems will automatically mount bpffs, debugfs and
	// tracefs if they are not already mounted.
	//
	// This is useful for some environments where those filesystems are not
	// mounted by default on the host, such as:
	// - minikube with the Docker driver
	// - Docker Desktop with WSL2
	// - Talos Linux
	AutoMountFilesystems bool
}

Jump to

Keyboard shortcuts

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