Documentation
¶
Index ¶
- Constants
- Variables
- func PreUpgrade() error
- type Builder
- func (sb *Builder) Build() *SPC
- func (sb *Builder) WithDiskType(diskType string) *Builder
- func (sb *Builder) WithGenerateName(name string) *Builder
- func (sb *Builder) WithMaxPool(val int) *Builder
- func (sb *Builder) WithName(name string) *Builder
- func (sb *Builder) WithOverProvisioning(val bool) *Builder
- func (sb *Builder) WithPool(poolType string) *Builder
- func (sb *Builder) WithPoolType(poolType string) *Builder
- func (sb *Builder) WithThickProvisioning(val bool) *Builder
- type Kubeclient
- func (k *Kubeclient) Create(spc *apis.StoragePoolClaim) (*apis.StoragePoolClaim, error)
- func (k *Kubeclient) Delete(name string, opts *metav1.DeleteOptions) error
- func (k *Kubeclient) Get(name string, opts metav1.GetOptions) (*apis.StoragePoolClaim, error)
- func (k *Kubeclient) List(opts metav1.ListOptions) (*apis.StoragePoolClaimList, error)
- func (k *Kubeclient) Update(spc *apis.StoragePoolClaim) (*apis.StoragePoolClaim, error)
- type KubeclientBuildOption
- type ListBuilder
- type PreUpgradeAction
- type Predicate
- type SPC
- type SPCList
Constants ¶
const (
// SPCFinalizer represents the finalizer on spc
SPCFinalizer = "storagepoolclaim.openebs.io/finalizer"
)
Variables ¶
var DefaultDiskCount = map[string]int{ string(apis.PoolTypeMirroredCPV): int(apis.MirroredBlockDeviceCountCPV), string(apis.PoolTypeStripedCPV): int(apis.StripedBlockDeviceCountCPV), string(apis.PoolTypeRaidzCPV): int(apis.RaidzBlockDeviceCountCPV), string(apis.PoolTypeRaidz2CPV): int(apis.Raidz2BlockDeviceCountCPV), }
DefaultDiskCount is a map containing the default block device count of various raid types.
var SupportedDiskTypes = map[apis.CasPoolValString]bool{ apis.TypeSparseCPV: true, apis.TypeDiskCPV: true, }
SupportedDiskTypes is a map containing the valid disk type
Functions ¶
Types ¶
type Builder ¶
type Builder struct {
Spc *SPC
}
Builder is the builder object for SPC.
func BuilderForAPIObject ¶
func BuilderForAPIObject(spc *apis.StoragePoolClaim) *Builder
BuilderForAPIObject returns an instance of the Builder object based on spc api object.
func BuilderForObject ¶
BuilderForObject returns an instance of the Builder object based on spc object
func NewBuilder ¶
func NewBuilder() *Builder
NewBuilder returns an empty instance of the Builder object.
func (*Builder) WithDiskType ¶
WithDiskType sets the Type field of spc with provided argument value.
func (*Builder) WithGenerateName ¶
WithGenerateName appends a random string after the name
func (*Builder) WithMaxPool ¶
WithMaxPool sets the maxpool field of spc with provided argument value.
func (*Builder) WithOverProvisioning ¶
WithOverProvisioning sets the OverProvisioning field of spc with provided argument value.
func (*Builder) WithPoolType ¶
WithPoolType sets the poolType field of spc with provided argument value.
func (*Builder) WithThickProvisioning ¶
WithThickProvisioning sets the ThickProvisioning field of spc with provided argument value.
type Kubeclient ¶
type Kubeclient struct {
// contains filtered or unexported fields
}
Kubeclient enables kubernetes API operations on cstor storage pool instance
func NewKubeClient ¶
func NewKubeClient(opts ...KubeclientBuildOption) *Kubeclient
NewKubeClient returns a new instance of kubeclient meant for cstor volume replica operations
func (*Kubeclient) Create ¶
func (k *Kubeclient) Create(spc *apis.StoragePoolClaim) (*apis.StoragePoolClaim, error)
Create creates a spc object
func (*Kubeclient) Delete ¶
func (k *Kubeclient) Delete(name string, opts *metav1.DeleteOptions) error
Delete deletes a spc object
func (*Kubeclient) Get ¶
func (k *Kubeclient) Get(name string, opts metav1.GetOptions) (*apis.StoragePoolClaim, error)
Get returns a spc object
func (*Kubeclient) List ¶
func (k *Kubeclient) List(opts metav1.ListOptions) (*apis.StoragePoolClaimList, error)
List returns a list of cstor pool instances present in kubernetes cluster
func (*Kubeclient) Update ¶
func (k *Kubeclient) Update(spc *apis.StoragePoolClaim) (*apis.StoragePoolClaim, error)
Update updates a spc object
type KubeclientBuildOption ¶
type KubeclientBuildOption func(*Kubeclient)
KubeclientBuildOption defines the abstraction to build a kubeclient instance
func WithKubeClient ¶
func WithKubeClient(c *clientset.Clientset) KubeclientBuildOption
WithKubeClient sets the kubernetes client against the kubeclient instance
func WithKubeConfigPath ¶
func WithKubeConfigPath(path string) KubeclientBuildOption
WithKubeConfigPath sets the kubeConfig path against client instance
type ListBuilder ¶
type ListBuilder struct {
SpcList *SPCList
}
ListBuilder is the builder object for SPCList.
func NewListBuilder ¶
func NewListBuilder() *ListBuilder
NewListBuilder returns a new instance of ListBuilder object.
func (*ListBuilder) List ¶
func (b *ListBuilder) List() *SPCList
List returns the list of csp instances that were built by this builder.
func (*ListBuilder) WithAPIList ¶
func (b *ListBuilder) WithAPIList(pools *apis.StoragePoolClaimList) *ListBuilder
WithAPIList builds the list based on the provided *apis.CStorPoolList.
func (*ListBuilder) WithList ¶
func (b *ListBuilder) WithList(pools *SPCList) *ListBuilder
WithList builds the list based on the provided *SPCList instances.
func (*ListBuilder) WithUIDs ¶
func (b *ListBuilder) WithUIDs(poolUIDs ...string) *ListBuilder
WithUIDs builds a list of StoragePoolClaims based on the provided pool UIDs
type PreUpgradeAction ¶
type PreUpgradeAction string
PreUpgradeAction is of string type Once the preupgrade checks are done, one of the below actions will be taken
const ( // DisableReconciler is an action to add the label DisableReconciler // Note: Not used as part of 1.1 preupgrade DisableReconciler PreUpgradeAction = "DisableReconciler" // Continue the preupgrade tasks Continue PreUpgradeAction = "Continue" // Abort running preupgrade tasks Abort PreUpgradeAction = "Abort" )
type Predicate ¶
Predicate defines an abstraction to determine conditional checks against the provided spc instance.
func HasAnnotation ¶
HasAnnotation returns true if provided annotation key and value are present in the provided spc instance.
func HasFinalizer ¶
HasFinalizer is a predicate to filter out based on provided finalizer being present on the object.
func IsOverProvisioningEnabled ¶
func IsOverProvisioningEnabled() Predicate
IsOverProvisioningEnabled returns OverProvisioning truth value. OverProvisioning field is deprecated and not honoured
func IsThickProvisioningEnabled ¶
func IsThickProvisioningEnabled() Predicate
IsThickProvisioningEnabled returns ThickProvisioning truth value.
type SPC ¶
type SPC struct { // actual spc object Object *apis.StoragePoolClaim }
SPC encapsulates StoragePoolClaim api object.
func (*SPC) AddFinalizer ¶
func (spc *SPC) AddFinalizer(finalizer string) (*apis.StoragePoolClaim, error)
AddFinalizer adds the given finalizer to the object.
func (*SPC) EstimateSPCVersion ¶
EstimateSPCVersion returns the csp version if any csp is present for the spc or returns the maya version as the new csp created will be of maya version
func (*SPC) HasFinalizer ¶
HasFinalizer returns true if the provided finalizer is present on the object.
func (*SPC) IsAutoProvisioning ¶
IsAutoProvisioning returns true if the spc is auto provisioning type
func (*SPC) RemoveFinalizer ¶
RemoveFinalizer removes the given finalizer from the object.
type SPCList ¶
type SPCList struct { // list of storagepoolclaims ObjectList *apis.StoragePoolClaimList }
SPCList holds the list of StoragePoolClaim api
func (*SPCList) Filter ¶
Filter will filter the csp instances if all the predicates succeed against that spc.
func (*SPCList) GetPoolUIDs ¶
GetPoolUIDs retuns the UIDs of the pools available in the list.