controllers

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2026 License: Apache-2.0 Imports: 41 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	MachineFinalizer = "machine"

	ArchitectureAARCH64 = "aarch64"
	ArchitectureX8664   = "x86_64"
)

Variables

View Source
var (
	ErrAttachedVolumeNotFound      = errors.New("volume not found")
	ErrAttachedVolumeAlreadyExists = errors.New("volume already exists")
)
View Source
var (
	ErrMountedVolumeNotFound = errors.New("mounted volume not found")
)
View Source
var ErrNotAssignedDomain = errors.New("not assigned to domain")

Functions

func ClaimedGPUsToHostDevs added in v0.3.0

func ClaimedGPUsToHostDevs(machine *api.Machine) []libvirtxml.DomainHostdev

func GetUniqueVolumeName

func GetUniqueVolumeName(pluginName, backingVolumeID string) string

func IsNotAssignedDomainErr added in v0.3.0

func IsNotAssignedDomainErr(err error) bool

Types

type AttachVolume

type AttachVolume struct {
	Name   string
	Device string
	Spec   providervolume.Volume
}

type DomainExecutor

type DomainExecutor interface {
	AttachDisk(disk *libvirtxml.DomainDisk) error
	DetachDisk(disk *libvirtxml.DomainDisk) error
	ResizeDisk(device string, size int64) error

	ApplySecret(secret *libvirtxml.Secret, data []byte) error
	DeleteSecret(secretUUID string) error
}

func NewCreateDomainExecutor

func NewCreateDomainExecutor(lv *libvirt.Libvirt) DomainExecutor

func NewRunningDomainExecutor

func NewRunningDomainExecutor(lv *libvirt.Libvirt, machineID string) DomainExecutor

type MachineReconciler

type MachineReconciler struct {
	// contains filtered or unexported fields
}

func NewMachineReconciler

func NewMachineReconciler(
	log logr.Logger,
	host providerhost.LibvirtHost,
	machines store.Store[*api.Machine],
	machineEvents event.Source[*api.Machine],
	eventRecorder recorder.EventRecorder,
	opts MachineReconcilerOptions,
) (*MachineReconciler, error)

func (*MachineReconciler) Start

func (r *MachineReconciler) Start(ctx context.Context) error

type MachineReconcilerOptions

type MachineReconcilerOptions struct {
	GuestCapabilities              guest.Capabilities
	TCMallocLibPath                string
	ImageCache                     ociutils.Cache
	Raw                            raw.Raw
	VolumePluginManager            *providervolume.PluginManager
	NetworkInterfacePlugin         providernetworkinterface.Plugin
	ResourceClaimer                claim.Claimer
	VolumeEvents                   event.Source[*api.Machine]
	ResyncIntervalGarbageCollector time.Duration
	EnableHugepages                bool
	GCVMGracefulShutdownTimeout    time.Duration
	VolumeCachePolicy              string
}

type MountVolume

type MountVolume = providerhost.MachineVolume

type VolumeAttacher

type VolumeAttacher interface {
	ListVolumes() ([]AttachVolume, error)
	ForEachVolume(f func(*AttachVolume) bool) error
	GetVolume(name string) (*AttachVolume, error)
	AttachVolume(volume *AttachVolume) error
	DetachVolume(name string) error
	ResizeVolume(volume *AttachVolume) error
}

func NewLibvirtVolumeAttacher

func NewLibvirtVolumeAttacher(domainDesc *libvirtxml.Domain, executor DomainExecutor, policy string) (VolumeAttacher, error)

type VolumeMounter

type VolumeMounter interface {
	PluginManager() *providervolume.PluginManager

	ForEachVolume(f func(*MountVolume) bool) error
	ListVolumes() ([]MountVolume, error)
	GetVolume(computeVolumeName string) (*MountVolume, error)
	ApplyVolume(ctx context.Context, spec *api.VolumeSpec, onDelete func(*MountVolume) error) (string, *providervolume.Volume, error)
	DeleteVolume(ctx context.Context, computeVolumeName string) error
}

Jump to

Keyboard shortcuts

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