shared

package
v0.15.2 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: MPL-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateNetworkConfig

func GenerateNetworkConfig(vm *models.MicroVM) (string, error)

GenerateNetworkConfig will generate the cloud-init network config from the vm spec.

func PIDReadFromFile

func PIDReadFromFile(pidFile string, fs afero.Fs) (int, error)

func PIDWriteToFile

func PIDWriteToFile(pid int, pidFile string, fs afero.Fs) error

func RemoveStaleSockets added in v0.15.2

func RemoveStaleSockets(fs afero.Fs, paths ...string) error

RemoveStaleSockets removes any of the given socket files that exist, so a VMM can bind to them on (re)create.

func ResolveImageFile added in v0.15.2

func ResolveImageFile(root, filename string) (string, error)

ResolveImageFile returns the host path of filename within the image mounted at root, which must be an absolute path. Symlinks are followed as if root were the filesystem root, so the result never escapes the mount. The result must be a regular file.

func ResolveSocketPath added in v0.15.2

func ResolveSocketPath(fs afero.Fs, path, legacyPath string) string

ResolveSocketPath returns the socket path for a process that is already running. That's path, unless only legacyPath exists, which means the process was started before sockets moved out of the state directory. Legacy fallback for #1226, to be removed in the next minor release.

Types

type MachineMetrics

type MachineMetrics struct {
	Namespace   string  `json:"Namespace"`
	MachineName string  `json:"MachineName"`
	MachineUID  string  `json:"MachineUID"`
	Data        Metrics `json:"Data"`
}

func (MachineMetrics) ToPrometheus

func (mm MachineMetrics) ToPrometheus() []byte

type Metrics

type Metrics map[string]map[string]int64

Jump to

Keyboard shortcuts

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