v1alpha2

package
v1.10.0-RC2 Latest Latest
Warning

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

Go to latest
Published: May 13, 2020 License: Apache-2.0 Imports: 21 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

KubeClient is for kubernetes CR operation

View Source
var OpenEBSClient clientset.Interface

OpenEBSClient is for openebs CR operation

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 GetCSPICapacity

func GetCSPICapacity(poolName string) (cstor.CStorPoolInstanceCapacity, error)

GetCSPICapacity returns the free, allocated and total capacities of pool in a structure

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 GetListOfPropertyValues

func 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 GetPropertyValue

func GetPropertyValue(poolName, property string) (string, error)

GetPropertyValue will return value of given property for given pool

func GetVolumePropertyValue

func GetVolumePropertyValue(poolName, property string) (string, error)

GetVolumePropertyValue is used to get pool properties using zfs commands

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

func SetCompression

func SetCompression(poolName string, compressionType string) error

SetCompression sets the cstor pool compression

func SetPoolRDMode

func SetPoolRDMode(poolName string, isROMode bool) error

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

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

Jump to

Keyboard shortcuts

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