controllers

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: Apache-2.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MachineFinalizer = "machine"
)

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")
)

Functions

func GetUniqueVolumeName

func GetUniqueVolumeName(pluginName, backingVolumeID string) string

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 {
	machineEvent.EventRecorder
	// contains filtered or unexported fields
}

func NewMachineReconciler

func NewMachineReconciler(
	log logr.Logger,
	libvirt *libvirt.Libvirt,
	machines store.Store[*api.Machine],
	machineEvents event.Source[*api.Machine],
	eventRecorder machineEvent.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                     providerimage.Cache
	Raw                            raw.Raw
	Host                           providerhost.Host
	VolumePluginManager            *providervolume.PluginManager
	NetworkInterfacePlugin         providernetworkinterface.Plugin
	VolumeEvents                   event.Source[*api.Machine]
	ResyncIntervalVolumeSize       time.Duration
	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