Documentation
¶
Index ¶
- Constants
- func ResolvePersistentDevPath(device *diskv1.BlockDevice) (string, error)
- func SetCondDeviceFormattingFail(device *diskv1.BlockDevice, err error)
- type DiskTags
- type LonghornV1Provisioner
- func (p *LonghornV1Provisioner) Format(devPath string) (bool, bool, error)
- func (p *LonghornV1Provisioner) GetProvisionerName() string
- func (p *LonghornV1Provisioner) Provision() (bool, error)
- func (p *LonghornV1Provisioner) UnFormat() (bool, error)
- func (p *LonghornV1Provisioner) UnProvision() (bool, error)
- func (p *LonghornV1Provisioner) Update() (bool, error)
- type NeedMountUpdateOP
- type Provisioner
- type Semaphore
Constants ¶
View Source
const ( TypeLonghornV1 = "LonghornV1" TypeLonghornV2 = "LonghornV2" TypeLVM = "LVM" // longhorn disk tags ErrorCacheDiskTagsNotInitialized = "CacheDiskTags is not initialized" // longhorn MountStatus NeedMountUpdateNoOp NeedMountUpdateOP = 1 << iota NeedMountUpdateMount NeedMountUpdateUnmount )
Variables ¶
This section is empty.
Functions ¶
func ResolvePersistentDevPath ¶
func ResolvePersistentDevPath(device *diskv1.BlockDevice) (string, error)
func SetCondDeviceFormattingFail ¶
func SetCondDeviceFormattingFail(device *diskv1.BlockDevice, err error)
Types ¶
type DiskTags ¶
type DiskTags struct {
// contains filtered or unexported fields
}
DiskTags is a cache mechanism for the blockdevices Tags (spec.Tags), it only changed from Harvester side.
func NewLonghornDiskTags ¶
func NewLonghornDiskTags() *DiskTags
func (*DiskTags) DeleteDiskTags ¶
func (*DiskTags) GetDiskTags ¶
func (*DiskTags) Initialized ¶
func (*DiskTags) UpdateDiskTags ¶
func (*DiskTags) UpdateInitialized ¶
func (d *DiskTags) UpdateInitialized()
type LonghornV1Provisioner ¶
type LonghornV1Provisioner struct {
// contains filtered or unexported fields
}
func (*LonghornV1Provisioner) Format ¶
func (p *LonghornV1Provisioner) Format(devPath string) (bool, bool, error)
func (*LonghornV1Provisioner) GetProvisionerName ¶
func (p *LonghornV1Provisioner) GetProvisionerName() string
func (*LonghornV1Provisioner) Provision ¶
func (p *LonghornV1Provisioner) Provision() (bool, error)
func (*LonghornV1Provisioner) UnFormat ¶
func (p *LonghornV1Provisioner) UnFormat() (bool, error)
func (*LonghornV1Provisioner) UnProvision ¶
func (p *LonghornV1Provisioner) UnProvision() (bool, error)
func (*LonghornV1Provisioner) Update ¶
func (p *LonghornV1Provisioner) Update() (bool, error)
Update is used to update the disk tags
type NeedMountUpdateOP ¶
type NeedMountUpdateOP int8
func (NeedMountUpdateOP) Has ¶
func (f NeedMountUpdateOP) Has(flag NeedMountUpdateOP) bool
type Provisioner ¶
type Provisioner interface {
// Format is the Prerequisites for the provisioner
// You should do the format-related operations (including mkfs, mount ...etc) here
// Return values: bool1: isFormatComplete, bool2: isRequeueNeeded, error: error
Format(string) (bool, bool, error)
// UnFormat is the cleanup operation for the provisioner
// You should call this after the UnProvision (if needed)
// Return values: bool: isRequeueNeeded, error: error
UnFormat() (bool, error)
// Provision is the main operation for the provisioner
// You should do all provision things like provision to specific storage, add to volume group ...etc
// Return values: bool: isRequeueNeeded, error: error
Provision() (bool, error)
// UnProvision is the cleanup operation for the provisioner
// You should cleanup all the things like remove from volume group, unprovision from storage ...etc
// Return values: bool: isRequeueNeeded, error: error
UnProvision() (bool, error)
// Update is the mechanism to update anything you needed.
// Like tags on the longhorn nodes, ensure the vg active for LVM ...etc
// Return values: bool: isRequeueNeeded, error: error
Update() (bool, error)
}
func NewLHV1Provisioner ¶
func NewLHV1Provisioner( device *diskv1.BlockDevice, block block.Info, nodeObj *longhornv1.Node, nodesClient ctllonghornv1.NodeClient, nodesClientCache ctllonghornv1.NodeCache, cacheDiskTags *DiskTags, semaphore *Semaphore, ) (Provisioner, error)
Click to show internal directories.
Click to hide internal directories.