v1alpha3

package
v1.12.0-RC2 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2020 License: Apache-2.0 Imports: 8 Imported by: 4

Documentation

Index

Constants

View Source
const (
	// StoragePoolKind holds the value of StoragePoolClaim
	StoragePoolKind = "StoragePoolClaim"
	// StoragePoolKindCSPC holds the value of CStorPoolCluster
	StoragePoolKindCSPC = "CStorPoolCluster"
	// APIVersion holds the value of OpenEBS version
	APIVersion = "openebs.io/v1alpha1"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder struct {
	CSPI *CSPI
	// contains filtered or unexported fields
}

Builder is the builder object for CStorPoolInstance

func BuilderForAPIObject

func BuilderForAPIObject(cspi *apis.CStorPoolInstance) *Builder

BuilderForAPIObject returns an instance of the Builder object based on CStorPool api object.

func BuilderForObject

func BuilderForObject(cspi *CSPI) *Builder

BuilderForObject returns an instance of the Builder object based on CStorPool object

func NewBuilder

func NewBuilder() *Builder

NewBuilder returns an empty instance of the Builder object

func (*Builder) Build

func (b *Builder) Build() (*CSPI, error)

Build returns the CStorPoolClaim instance

func (*Builder) WithAnnotations

func (b *Builder) WithAnnotations(annotations map[string]string) *Builder

WithAnnotations appends or overwrites existing Annotations values of CSPI with provided arguments

func (*Builder) WithAnnotationsNew

func (b *Builder) WithAnnotationsNew(annotations map[string]string) *Builder

WithAnnotationsNew sets the Annotations field of CSPI with provided arguments

func (*Builder) WithCSPCOwnerReference

func (b *Builder) WithCSPCOwnerReference(cspic *apis.CStorPoolCluster) *Builder

WithCSPCOwnerReference sets the OwnerReference field in CSPI with required fields

func (*Builder) WithDependentsUpgraded

func (b *Builder) WithDependentsUpgraded() *Builder

WithDependentsUpgraded sets the field to true for new CSPI

func (*Builder) WithFinalizer

func (b *Builder) WithFinalizer(finalizers ...string) *Builder

WithFinalizer sets the finalizer field in the BDC

func (*Builder) WithLabels

func (b *Builder) WithLabels(labels map[string]string) *Builder

WithLabels appends or overwrites existing Labels values of CSPI with provided arguments

func (*Builder) WithLabelsNew

func (b *Builder) WithLabelsNew(labels map[string]string) *Builder

WithLabelsNew sets the Labels field of CSPI with provided arguments

func (*Builder) WithName

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

WithName sets the Name field of CSPI with provided value.

func (*Builder) WithNamespace

func (b *Builder) WithNamespace(namespace string) *Builder

WithNamespace sets the Namespace field of CSPI provided arguments

func (*Builder) WithNewVersion

func (b *Builder) WithNewVersion(version string) *Builder

WithNewVersion sets the current and desired version field of CSPI with provided arguments

func (*Builder) WithNodeName

func (b *Builder) WithNodeName(nodeName string) *Builder

WithNodeName sets the HostName field of CSPI with the provided argument.

func (*Builder) WithNodeSelectorByReference

func (b *Builder) WithNodeSelectorByReference(nodeSelector map[string]string) *Builder

WithNodeSelectorByReference sets the node selector field of CSPI with provided argument.

func (*Builder) WithOwnerReference

func (b *Builder) WithOwnerReference(spc *apis.StoragePoolClaim) *Builder

WithOwnerReference sets the OwnerReference field in CSPI with required fields

func (*Builder) WithPoolConfig

func (b *Builder) WithPoolConfig(poolConfig *apis.PoolConfig) *Builder

WithPoolConfig sets the pool config field of the CSPI with the provided config.

func (*Builder) WithRaidGroups

func (b *Builder) WithRaidGroups(raidGroup []apis.RaidGroup) *Builder

WithRaidGroups sets the raid group field of the CSPI with the provided raid groups.

type CSPI

type CSPI struct {
	// actual CSPI object
	Object *apis.CStorPoolInstance
}

CSPI encapsulates CStorPoolInstance api object.

func (*CSPI) HasAnnotation

func (c *CSPI) HasAnnotation(key, value string) bool

HasAnnotation return true if provided annotation key and value are present in the the provided CSPIList instance

func (*CSPI) HasLabel

func (c *CSPI) HasLabel(key, value string) bool

HasLabel returns true if provided label key and value are present in the provided CSPI

func (*CSPI) HasNodeName

func (c *CSPI) HasNodeName(nodeName string) bool

HasNodeName returns true if the CSPI belongs to the provided node name.

func (*CSPI) IsStatus

func (c *CSPI) IsStatus(status string) bool

IsStatus returns true if the status on block device claim matches with provided status.

type CSPIList

type CSPIList struct {
	// list of CSPIs
	ObjectList *apis.CStorPoolInstanceList
}

CSPIList encapsulates CStorPoolList api object

func (*CSPIList) Filter

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

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

func (*CSPIList) Len

func (c *CSPIList) Len() int

Len returns the length of CStorPoolInstanceList.

type Kubeclient

type Kubeclient struct {
	// contains filtered or unexported fields
}

Kubeclient enables kubernetes API operations on cspi instance

func NewKubeClient

func NewKubeClient(opts ...KubeclientBuildOption) *Kubeclient

NewKubeClient returns a new instance of kubeclient meant for cspi operations

func (*Kubeclient) Create

Create creates a cspi in specified namespace in kubernetes cluster

func (*Kubeclient) Delete

func (k *Kubeclient) Delete(name string, deleteOpts *metav1.DeleteOptions) error

Delete deletes a cspi instance from the kubecrnetes cluster

func (*Kubeclient) DeleteCollection

func (k *Kubeclient) DeleteCollection(listOpts metav1.ListOptions, deleteOpts *metav1.DeleteOptions) error

DeleteCollection deletes a collection of cspi objects.

func (*Kubeclient) Get

Get returns a disk object

func (*Kubeclient) List

List returns a list of disk instances present in kubernetes cluster

func (*Kubeclient) Patch

func (k *Kubeclient) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (*apis.CStorPoolInstance, error)

Patch patches the cspi claim if present in kubernetes cluster

func (*Kubeclient) Update

Update updates the cspi if present in kubernetes cluster

func (*Kubeclient) WithDefaults

func (k *Kubeclient) WithDefaults()

WithDefaults sets the default options of kubeclient instance

func (*Kubeclient) WithNamespace

func (k *Kubeclient) WithNamespace(namespace string) *Kubeclient

WithNamespace sets the kubernetes namespace against the provided namespace

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(kubeConfigPath string) KubeclientBuildOption

WithKubeConfigPath sets the kubeConfig path against client instance

type ListBuilder

type ListBuilder struct {
	CSPList *CSPIList
	// contains filtered or unexported fields
}

ListBuilder is the builder object for CSPIList

func ListBuilderFromAPIList

func ListBuilderFromAPIList(cspl *apis.CStorPoolInstanceList) *ListBuilder

ListBuilderFromAPIList builds the list based on the provided API CSP List

func ListBuilderFromList

func ListBuilderFromList(cspl *CSPIList) *ListBuilder

ListBuilderFromList builds the list based on the provided *CSPIList instances.

func NewListBuilder

func NewListBuilder() *ListBuilder

NewListBuilder returns a new instance of ListBuilder object.

func (*ListBuilder) GetCStorPool

func (lb *ListBuilder) GetCStorPool(cspName string) *apis.CStorPoolInstance

GetCStorPool returns CStorPoolInstance object from existing ListBuilder

func (*ListBuilder) List

func (lb *ListBuilder) List() *CSPIList

List returns the list of csp instances that was built by this builder

func (*ListBuilder) WithFilter

func (lb *ListBuilder) WithFilter(pred ...Predicate) *ListBuilder

WithFilter adds filters on which the csp's has to be filtered

type Predicate

type Predicate func(*CSPI) bool

Predicate defines an abstraction to determine conditional checks against the provided CStorPoolInstance

func HasAnnotation

func HasAnnotation(key, value string) Predicate

HasAnnotation is predicate to filter out based on annotation in CSPI instances

func HasLabel

func HasLabel(key, value string) Predicate

HasLabel is predicate to filter out labeled CSPI instances

func HasNodeName

func HasNodeName(nodeName string) Predicate

HasNodeName is predicate to filter out based on node name of CSPI instances.

func IsStatus

func IsStatus(status string) Predicate

IsStatus is predicate to filter out CSP instances based on argument provided

type PredicateList

type PredicateList []Predicate

PredicateList holds the list of Predicates

Jump to

Keyboard shortcuts

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