Documentation ¶
Index ¶
- Constants
- Variables
- func CheckImportedPoolVolume()
- func ErrorWrapf(err error, format string, args ...interface{}) error
- func GetCapacityFromString(capacity string) (resource.Quantity, error)
- func GetCapacityInBinarySi(capacity string) string
- func GetPropertyValue(poolName, property string, executor bin.Executor) (string, error)
- func IsEmpty(s string) bool
- func PoolName() string
- type OperationsConfig
- func (oc *OperationsConfig) ClearPoolLabel(raidGroups ...cstor.RaidGroup)
- func (oc *OperationsConfig) Create(cspi *cstor.CStorPoolInstance) error
- func (oc *OperationsConfig) Delete(cspi *cstor.CStorPoolInstance) error
- func (oc *OperationsConfig) GetCSPICapacity(poolName string) (cstor.CStorPoolInstanceCapacity, error)
- func (oc *OperationsConfig) GetListOfPropertyValues(poolName string, propertyList []string) ([]string, error)
- func (oc *OperationsConfig) GetUnavailableDiskList(cspi *cstor.CStorPoolInstance) ([]string, error)
- func (oc *OperationsConfig) GetVolumePropertyValue(poolName, property string) (string, error)
- func (oc *OperationsConfig) Import(cspi *cstor.CStorPoolInstance) (bool, error)
- func (oc *OperationsConfig) SetCompression(poolName string, compressionType string) error
- func (oc *OperationsConfig) SetPoolRDMode(poolName string, isROMode bool) error
- func (oc *OperationsConfig) Update(cspi *cstor.CStorPoolInstance) (*cstor.CStorPoolInstance, error)
- func (oc *OperationsConfig) WithKubeClientSet(ks kubernetes.Interface) *OperationsConfig
- func (oc *OperationsConfig) WithOpenEBSClient(ocs openebsclientset.Interface) *OperationsConfig
- func (oc *OperationsConfig) WithRecorder(recorder record.EventRecorder) *OperationsConfig
- func (oc *OperationsConfig) WithZcmdExecutor(executor zcmd.Executor) *OperationsConfig
Constants ¶
const ( // DeviceTypeSpare .. spare device type DeviceTypeSpare = "spare" // DeviceTypeReadCache .. read cache device type DeviceTypeReadCache = "cache" // DeviceTypeWriteCache .. write cache device type DeviceTypeWriteCache = "log" // DeviceTypeData .. data disk device type DeviceTypeData = "data" )
const ( // PoolPrefix is prefix for pool name PoolPrefix string = "cstor-" )
Variables ¶
Functions ¶
func CheckImportedPoolVolume ¶
func CheckImportedPoolVolume()
CheckImportedPoolVolume will notify CVR controller for new imported pool's volumes
func ErrorWrapf ¶
ErrorWrapf wrap error If given err is nil then it will return new error
func GetCapacityFromString ¶
GetCapacityFromString will return value of given capacity in resource.Quantity form.
func GetCapacityInBinarySi ¶
GetCapacityInBinarySi replaces the unit to binary SI. zfs reports capacity in binary si i.e 1024 is the conversion factor. but the unit is K,M,G etc instead of Ki, Mi, Gi ToDO: This function currently only converts "K" --> "k" ( Ideally it should be "K" --> "Ki" and similarly ToDo: for other units. Revisit this.
func GetPropertyValue ¶
GetPropertyValue will return value of given property for given pool
Types ¶
type OperationsConfig ¶
type OperationsConfig struct {
// contains filtered or unexported fields
}
func NewOperationsConfig ¶
func NewOperationsConfig() *OperationsConfig
NewOperationsConfig builds the new instance of OperationsConfig
func (*OperationsConfig) ClearPoolLabel ¶
func (oc *OperationsConfig) ClearPoolLabel(raidGroups ...cstor.RaidGroup)
ClearPoolLabel clears the pool labels on disks
func (*OperationsConfig) Create ¶
func (oc *OperationsConfig) Create(cspi *cstor.CStorPoolInstance) error
Create will create the pool for given csp object
func (*OperationsConfig) Delete ¶
func (oc *OperationsConfig) Delete(cspi *cstor.CStorPoolInstance) error
Delete will destroy the pool for given cspi. It will also perform labelclear for pool disk.
func (*OperationsConfig) GetCSPICapacity ¶ added in v1.11.0
func (oc *OperationsConfig) GetCSPICapacity(poolName string) (cstor.CStorPoolInstanceCapacity, error)
GetCSPICapacity returns the free, allocated and total capacities of pool in a structure
func (*OperationsConfig) GetListOfPropertyValues ¶ added in v1.11.0
func (oc *OperationsConfig) GetListOfPropertyValues( poolName string, propertyList []string) ([]string, error)
GetListOfPropertyValues will return value list for given property list NOTE: It will return the property values in the same order as property list
func (*OperationsConfig) GetUnavailableDiskList ¶
func (oc *OperationsConfig) GetUnavailableDiskList(cspi *cstor.CStorPoolInstance) ([]string, error)
GetUnavailableDiskList returns the list of faulted disks from the current pool
func (*OperationsConfig) GetVolumePropertyValue ¶ added in v1.11.0
func (oc *OperationsConfig) GetVolumePropertyValue(poolName, property string) (string, error)
GetVolumePropertyValue is used to get pool properties using zfs commands
func (*OperationsConfig) Import ¶
func (oc *OperationsConfig) Import(cspi *cstor.CStorPoolInstance) (bool, error)
Import will import pool for given CSPI object. It will always set `cachefile` property for that pool It will return following thing - If pool is imported or not - If any error occurred during import operation
func (*OperationsConfig) SetCompression ¶ added in v1.11.0
func (oc *OperationsConfig) SetCompression(poolName string, compressionType string) error
SetCompression sets the cstor pool compression
func (*OperationsConfig) SetPoolRDMode ¶ added in v1.11.0
func (oc *OperationsConfig) SetPoolRDMode(poolName string, isROMode bool) error
SetPoolRDMode set the pool ReadOnly property based on the arrgument
func (*OperationsConfig) Update ¶
func (oc *OperationsConfig) Update(cspi *cstor.CStorPoolInstance) (*cstor.CStorPoolInstance, error)
Update will update the deployed pool according to given cspi object NOTE: Update returns both CSPI as well as error
func (*OperationsConfig) WithKubeClientSet ¶
func (oc *OperationsConfig) WithKubeClientSet(ks kubernetes.Interface) *OperationsConfig
WithKubeClientSet fills the kubernetes client to perform operation on kubernetes resorces
func (*OperationsConfig) WithOpenEBSClient ¶
func (oc *OperationsConfig) WithOpenEBSClient(ocs openebsclientset.Interface) *OperationsConfig
WithOpenEBSClient fills openebs client to controller object.
func (*OperationsConfig) WithRecorder ¶
func (oc *OperationsConfig) WithRecorder(recorder record.EventRecorder) *OperationsConfig
WithRecorder fills recorder to generate events on CSPI
func (*OperationsConfig) WithZcmdExecutor ¶ added in v1.11.0
func (oc *OperationsConfig) WithZcmdExecutor(executor zcmd.Executor) *OperationsConfig
WithZcmdExecutor fills the zcmdExecutor to execute ZPOOL/ZFS commands