Documentation ¶
Index ¶
- Constants
- Variables
- func CheckImportedPoolVolume()
- func ErrorWrapf(err error, format string, args ...interface{}) error
- func GetCSPICapacity(poolName string) (cstor.CStorPoolInstanceCapacity, error)
- func GetCapacityFromString(capacity string) (resource.Quantity, error)
- func GetCapacityInBinarySi(capacity string) string
- func GetListOfPropertyValues(poolName string, propertyList []string) ([]string, error)
- func GetPropertyValue(poolName, property string) (string, error)
- func GetVolumePropertyValue(poolName, property string) (string, error)
- func IsEmpty(s string) bool
- func PoolName() string
- func SetCompression(poolName string, compressionType string) error
- func SetPoolRDMode(poolName string, isROMode bool) error
- 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) GetUnavailableDiskList(cspi *cstor.CStorPoolInstance) ([]string, error)
- func (oc *OperationsConfig) Import(cspi *cstor.CStorPoolInstance) (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
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 ¶
var KubeClient kubernetes.Interface
KubeClient is for kubernetes CR operation
var OpenEBSClient clientset.Interface
OpenEBSClient is for openebs CR operation
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 GetCSPICapacity ¶
func GetCSPICapacity(poolName string) (cstor.CStorPoolInstanceCapacity, error)
GetCSPICapacity returns the free, allocated and total capacities of pool in a structure
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 GetListOfPropertyValues ¶
GetListOfPropertyValues will return value list for given property list NOTE: It will return the property values in the same order as property list
func GetPropertyValue ¶
GetPropertyValue will return value of given property for given pool
func GetVolumePropertyValue ¶
GetVolumePropertyValue is used to get pool properties using zfs commands
func SetCompression ¶
SetCompression sets the cstor pool compression
func SetPoolRDMode ¶
SetPoolRDMode set the pool ReadOnly property based on the arrgument
Types ¶
type OperationsConfig ¶
type OperationsConfig struct {
// contains filtered or unexported fields
}
func NewOperationsConfig ¶
func NewOperationsConfig() *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) GetUnavailableDiskList ¶
func (oc *OperationsConfig) GetUnavailableDiskList(cspi *cstor.CStorPoolInstance) ([]string, error)
GetUnavailableDiskList returns the list of faulted disks from the current pool
func (*OperationsConfig) Import ¶
func (oc *OperationsConfig) Import(cspi *cstor.CStorPoolInstance) (bool, error)
Import will import pool for given CSPI object. It will also set `cachefile` property for that pool if it is mentioned in object It will return following thing - If pool is imported or not - If any error occurred during import operation
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