Documentation
¶
Index ¶
- Constants
- func VerifyMandatoryDevicePaths(f FilteredBlockDevices, resolver *symlinkResolver.Resolver, ...) error
- type AllocationPolicy
- type EventReasonError
- type EventReasonInfo
- type FilteredBlockDevice
- type FilteredBlockDevices
- type LvAttr
- type Minor
- type Open
- type OpenTarget
- type Partial
- type Permissions
- type Reconciler
- func (r *Reconciler) NormalEvent(ctx context.Context, obj *lvmv1alpha1.LVMVolumeGroup, reason EventReasonInfo, ...)
- func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *Reconciler) SetupWithManager(mgr ctrl.Manager) error
- func (r *Reconciler) WarningEvent(ctx context.Context, obj *lvmv1alpha1.LVMVolumeGroup, reason EventReasonError, ...)
- type State
- type VolumeType
- type Zero
Constants ¶
const ( ControllerName = "vg-manager" // NodeCleanupFinalizer should be set on a LVMVolumeGroup for every Node matching that LVMVolumeGroup. // When the LVMVolumeGroup gets deleted, this finalizer will stay on the VolumeGroup until the vgmanager instance // on that node has fulfilled all cleanup routines for the vg (remove lvs, vgs, pvs and lvmd conf entry). NodeCleanupFinalizer = "cleanup.vgmanager.node.topolvm.io" )
const ( OpenTargetMirror = 'm' OpenTargetRaid = 'r' OpenTargetSnapshot = 's' OpenTargetThin = 't' OpenTargetUnknown = 'u' OpenTargetVirtual = 'v' )
const ( PartialTrue = 'p' PartialFalse = '-' )
Variables ¶
This section is empty.
Functions ¶
func VerifyMandatoryDevicePaths ¶
func VerifyMandatoryDevicePaths(f FilteredBlockDevices, resolver *symlinkResolver.Resolver, paths []v1alpha1.DevicePath) error
VerifyMandatoryDevicePaths verifies if the provided device list is either available or already setup correctly. While availability is easy to determine, an exclusion by being already setup can only be determined by checking if the excluded device has been filtered due to filter.ErrDeviceAlreadySetupCorrectly.
Types ¶
type AllocationPolicy ¶
type AllocationPolicy rune
const ( AllocationPolicyAnywhere AllocationPolicy = 'a' AllocationPolicyAnywhereLocked AllocationPolicy = 'A' AllocationPolicyContiguous AllocationPolicy = 'c' AllocationPolicyContiguousLocked AllocationPolicy = 'C' AllocationPolicyInherited AllocationPolicy = 'i' AllocationPolicyInheritedLocked AllocationPolicy = 'I' AllocationPolicyCling AllocationPolicy = 'l' AllocationPolicyClingLocked AllocationPolicy = 'L' AllocationPolicyNormal AllocationPolicy = 'n' AllocationPolicyNormalLocked AllocationPolicy = 'N' AllocationPolicyNone = '-' )
type EventReasonError ¶
type EventReasonError string
const EventReasonErrorDevicePathCheckFailed EventReasonError = "DevicePathCheckFailed"
const EventReasonErrorInconsistentLVs EventReasonError = "InconsistentLVs"
const EventReasonErrorNoAvailableDevicesForVG EventReasonError = "NoAvailableDevicesForVG"
const EventReasonErrorThinPoolCreateOrExtendFailed EventReasonError = "ThinPoolCreateOrExtendFailed"
const EventReasonErrorVGCreateOrExtendFailed EventReasonError = "VGCreateOrExtendFailed"
type EventReasonInfo ¶
type EventReasonInfo string
const EventReasonLVMDConfigDeleted EventReasonInfo = "LVMDConfigDeleted"
const EventReasonLVMDConfigMissing EventReasonInfo = "LVMDConfigMissing"
const EventReasonLVMDConfigUpdated EventReasonInfo = "LVMDConfigUpdated"
const EventReasonVolumeGroupReady EventReasonInfo = "VolumeGroupReady"
type FilteredBlockDevice ¶
type FilteredBlockDevice struct { lsblk.BlockDevice FilterErrors []error }
type FilteredBlockDevices ¶
type FilteredBlockDevices struct { Available []lsblk.BlockDevice Excluded []FilteredBlockDevice }
func (FilteredBlockDevices) FilterErrors ¶
func (f FilteredBlockDevices) FilterErrors(dev string) []error
FilterErrors checks if the provided device is already setup correctly in an existing volume group (all filters decided the device is either okay to use or returned filter.ErrDeviceAlreadySetupCorrectly).
func (FilteredBlockDevices) IsAvailable ¶
func (f FilteredBlockDevices) IsAvailable(dev string) bool
IsAvailable checks if the provided device is available for use in a new volume group.
type LvAttr ¶
type LvAttr struct { VolumeType Permissions AllocationPolicy Minor State Open OpenTarget Zero Partial }
LvAttr has mapped lv_attr information, see https://linux.die.net/man/8/lvs It is a complete parsing of the entire attribute byte flags that is attached to each LV. This is useful when attaching logic to the state of an LV as the state of an LV can be determined from the Attributes, e.g. for determining whether an LV is considered a Thin-Pool or not.
func ParsedLvAttr ¶
type OpenTarget ¶
type OpenTarget rune
type Permissions ¶
type Permissions rune
const ( PermissionsWriteable Permissions = 'w' PermissionsReadOnly Permissions = 'r' PermissionsReadOnlyActivationOfNonReadOnlyVolume Permissions = 'R' PermissionsNone Permissions = '-' )
type Reconciler ¶
type Reconciler struct { client.Client Scheme *runtime.Scheme record.EventRecorder LVMD lvmd.Configurator lvm.LVM lsblk.LSBLK wipefs.Wipefs dmsetup.Dmsetup NodeName string Namespace string Filters filter.FilterSetup SymlinkResolveFn symlinkResolver.ResolveFn }
func (*Reconciler) NormalEvent ¶
func (r *Reconciler) NormalEvent(ctx context.Context, obj *lvmv1alpha1.LVMVolumeGroup, reason EventReasonInfo, message string)
NormalEvent sends an event to both the nodeStatus, and the affected processed volumeGroup as well as the owning LVMCluster if present
func (*Reconciler) SetupWithManager ¶
func (r *Reconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
func (*Reconciler) WarningEvent ¶
func (r *Reconciler) WarningEvent(ctx context.Context, obj *lvmv1alpha1.LVMVolumeGroup, reason EventReasonError, errMsg error)
WarningEvent sends an event to both the nodeStatus, and the affected processed volumeGroup as well as the owning LVMCluster if present
type State ¶
type State rune
const ( StateActive State = 'a' StateSuspended State = 's' StateInvalidSnapshot State = 'I' StateSuspendedSnapshot State = 'S' StateSnapshotMergeFailed State = 'm' StateSuspendedSnapshotMergeFailed State = 'M' StateMappedDevicePresentWithoutTables State = 'd' StateMappedDevicePresentWithInactiveTables State = 'i' StateNone State = '-' )
type VolumeType ¶
type VolumeType rune
const ( VolumeTypeMirrored VolumeType = 'm' VolumeTypeMirroredNoInitialSync VolumeType = 'M' VolumeTypeOrigin VolumeType = 'o' VolumeTypeOriginWithMergingSnapshot VolumeType = 'O' VolumeTypeRAID VolumeType = 'r' VolumeTypeRAIDNoInitialSync VolumeType = 'R' VolumeTypeSnapshot VolumeType = 's' VolumeTypeMergingSnapshot VolumeType = 'S' VolumeTypePVMove VolumeType = 'p' VolumeTypeVirtual VolumeType = 'v' VolumeTypeMirrorOrRAIDImage VolumeType = 'i' VolumeTypeMirrorOrRAIDImageOutOfSync VolumeType = 'I' VolumeTypeMirrorLogDevice VolumeType = 'l' VolumeTypeUnderConversion VolumeType = 'c' VolumeTypeThinVolume VolumeType = 'V' VolumeTypeThinPool VolumeType = 't' VolumeTypeThinPoolData VolumeType = 'T' VolumeTypeThinPoolMetadata VolumeType = 'e' VolumeTypeNone VolumeType = '-' )