v1alpha1

package
v1.11.0-RC1 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2020 License: Apache-2.0 Imports: 15 Imported by: 4

Documentation

Index

Constants

View Source
const (
	// SPCFinalizer represents the finalizer on spc
	SPCFinalizer = "storagepoolclaim.openebs.io/finalizer"
)

Variables

DefaultDiskCount is a map containing the default block device count of various raid types.

SupportedDiskTypes is a map containing the valid disk type

Functions

func PreUpgrade

func PreUpgrade() error

PreUpgrade performs 1.1 preupgrade tasks for all SPCs

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

func BuilderForObject(SPC *SPC) *Builder

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) Build

func (sb *Builder) Build() *SPC

Build returns the SPC object built by this builder.

func (*Builder) WithDiskType

func (sb *Builder) WithDiskType(diskType string) *Builder

WithDiskType sets the Type field of spc with provided argument value.

func (*Builder) WithGenerateName

func (sb *Builder) WithGenerateName(name string) *Builder

WithGenerateName appends a random string after the name

func (*Builder) WithMaxPool

func (sb *Builder) WithMaxPool(val int) *Builder

WithMaxPool sets the maxpool field of spc with provided argument value.

func (*Builder) WithName

func (sb *Builder) WithName(name string) *Builder

WithName sets the Name field of spc with provided argument value.

func (*Builder) WithOverProvisioning

func (sb *Builder) WithOverProvisioning(val bool) *Builder

WithOverProvisioning sets the OverProvisioning field of spc with provided argument value.

func (*Builder) WithPool

func (sb *Builder) WithPool(poolType string) *Builder

WithPool sets the poolType field of spc with provided argument value.

func (*Builder) WithPoolType

func (sb *Builder) WithPoolType(poolType string) *Builder

WithPoolType sets the poolType field of spc with provided argument value.

func (*Builder) WithThickProvisioning

func (sb *Builder) WithThickProvisioning(val bool) *Builder

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

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

List returns a list of cstor pool instances present in kubernetes cluster

func (*Kubeclient) Update

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

type Predicate func(*SPC) bool

Predicate defines an abstraction to determine conditional checks against the provided spc instance.

func HasAnnotation

func HasAnnotation(key, value string) Predicate

HasAnnotation returns true if provided annotation key and value are present in the provided spc instance.

func HasFinalizer

func HasFinalizer(finalizer string) Predicate

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

func (spc *SPC) EstimateSPCVersion() (string, error)

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

func (spc *SPC) HasFinalizer(finalizer string) bool

HasFinalizer returns true if the provided finalizer is present on the object.

func (*SPC) IsAutoProvisioning

func (spc *SPC) IsAutoProvisioning() bool

IsAutoProvisioning returns true if the spc is auto provisioning type

func (*SPC) RemoveFinalizer

func (spc *SPC) RemoveFinalizer(finalizer string) error

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

func (l *SPCList) Filter(p ...Predicate) *SPCList

Filter will filter the csp instances if all the predicates succeed against that spc.

func (*SPCList) GetPoolUIDs

func (l *SPCList) GetPoolUIDs() []string

GetPoolUIDs retuns the UIDs of the pools available in the list.

func (*SPCList) IsEmpty

func (l *SPCList) IsEmpty() bool

IsEmpty returns false if the SPCList is empty.

func (*SPCList) Len

func (l *SPCList) Len() int

Len returns the length og SPCList.

Jump to

Keyboard shortcuts

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