v1alpha2

package
v1.12.1 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2020 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
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"
)
View Source
const (
	// PoolPrefix is prefix for pool name
	PoolPrefix string = "cstor-"
)

Variables

View Source
var SupportedCompressionTypes = map[string]bool{
	"on":     true,
	"off":    true,
	"lz4":    true,
	"gle":    true,
	"lzjb":   true,
	"gzip":   true,
	"gzip-1": true,
	"gzip-2": true,
	"gzip-3": true,
	"gzip-4": true,
	"gzip-5": true,
	"gzip-6": true,
	"gzip-7": true,
	"gzip-8": true,
	"gzip-9": true,
}

Functions

func CheckImportedPoolVolume

func CheckImportedPoolVolume()

CheckImportedPoolVolume will notify CVR controller for new imported pool's volumes

func ErrorWrapf

func ErrorWrapf(err error, format string, args ...interface{}) error

ErrorWrapf wrap error If given err is nil then it will return new error

func GetCapacityFromString

func GetCapacityFromString(capacity string) (resource.Quantity, error)

GetCapacityFromString will return value of given capacity in resource.Quantity form.

func GetCapacityInBinarySi

func GetCapacityInBinarySi(capacity string) string

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

func GetPropertyValue(poolName, property string, executor bin.Executor) (string, error)

GetPropertyValue will return value of given property for given pool

func IsEmpty

func IsEmpty(s string) bool

IsEmpty check if string is empty or not

func PoolName

func PoolName() string

PoolName return pool name for given CSPI object

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

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL