v1alpha1

package
v1.12.1 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2020 License: Apache-2.0 Imports: 11 Imported by: 4

Documentation

Index

Constants

View Source
const (
	// CSPCFinalizer represents finalizer value used by cspc
	CSPCFinalizer = "cstorpoolcluster.openebs.io/finalizer"
	// PoolProtectionFinalizer is used to make sure cspi and it's bdcs
	// are not deleted before destroying the zpool
	PoolProtectionFinalizer = "openebs.io/pool-protection"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

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

Builder is the builder object for CSPC

func BuilderForAPIObject

func BuilderForAPIObject(cspc *apisv1alpha1.CStorPoolCluster) *Builder

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

func NewBuilder

func NewBuilder() *Builder

NewBuilder returns new instance of Builder

func (*Builder) Build

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

Build returns the CSPC instance

func (*Builder) GetObj

func (b *Builder) GetObj() (*apisv1alpha1.CStorPoolCluster, error)

GetObj returns the CSPC instance

func (*Builder) WithGenerateName

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

WithGenerateName appends a random string after the name

func (*Builder) WithName

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

WithName sets the Name field of CSPC with provided value.

func (*Builder) WithNamespace

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

WithNamespace sets the Namespace field of CSPC with provided value.

func (*Builder) WithPoolSpecBuilder

func (b *Builder) WithPoolSpecBuilder(poolSpecBuilder *poolspec.Builder) *Builder

WithPoolSpecBuilder adds a pool to this cspc object.

NOTE:

poolspec details are present in the provided pool spec

builder object

type CSPC

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

CSPC is a wrapper over cstorpoolcluster api object. It provides build, validations and other common logic to be used by various feature specific callers.

func NewForAPIObject

func NewForAPIObject(obj *apisv1alpha1.CStorPoolCluster, opts ...cspcBuildOption) *CSPC

NewForAPIObject returns a new instance of CSPC

func (*CSPC) AddFinalizer

func (c *CSPC) AddFinalizer(finalizer string) (*apisv1alpha1.CStorPoolCluster, error)

AddFinalizer adds the given finalizer to the object.

func (*CSPC) HasFinalizer

func (c *CSPC) HasFinalizer(finalizer string) bool

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

func (*CSPC) IsNil

func (c *CSPC) IsNil() bool

IsNil returns true if the CSPC instance is nil

func (*CSPC) RemoveFinalizer

func (c *CSPC) RemoveFinalizer(finalizer string) error

RemoveFinalizer removes the given finalizer from the object.

type CSPCList

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

CSPCList is a wrapper over cstorpoolcluster api object. It provides build, validations and other common logic to be used by various feature specific callers.

func (*CSPCList) Len

func (c *CSPCList) Len() int

Len returns the number of items present in the CSPCList

func (*CSPCList) ToAPIList

func (c *CSPCList) ToAPIList() *apisv1alpha1.CStorPoolClusterList

ToAPIList converts CSPCList to API CSPCList

type Kubeclient

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

Kubeclient enables kubernetes API operations on CStorPoolCluster instance

func NewKubeClient

func NewKubeClient(opts ...KubeclientBuildOption) *Kubeclient

NewKubeClient returns a new instance of kubeclient meant for CStorPoolCluster operations

func (*Kubeclient) Create

Create creates a cspc in specified namespace in kubernetes cluster

func (*Kubeclient) Delete

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

Delete deletes a cspc instance from the kubecrnetes cluster

func (*Kubeclient) DeleteCollection

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

DeleteCollection deletes a collection of cspc 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) (*apisv1alpha1.CStorPoolCluster, error)

Patch patches the CStorPoolCluster claim if present in kubernetes cluster

func (*Kubeclient) Update

Update updates the cspc in specified namespace 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 {
	// contains filtered or unexported fields
}

ListBuilder enables building an instance of CSPCList

func ListBuilderForAPIObjects

func ListBuilderForAPIObjects(cspcs *apisv1alpha1.CStorPoolClusterList) *ListBuilder

ListBuilderForAPIObjects builds the ListBuilder object based on CSPC api list

func ListBuilderForObjects

func ListBuilderForObjects(cspcs *CSPCList) *ListBuilder

ListBuilderForObjects builds the ListBuilder object based on CSPCList

func NewListBuilder

func NewListBuilder() *ListBuilder

NewListBuilder returns an instance of ListBuilder

func (*ListBuilder) APIList

APIList builds core API CSPC list using listbuilder

func (*ListBuilder) Len

func (b *ListBuilder) Len() (int, error)

Len returns the number of items present in the CSPCList of a builder

func (*ListBuilder) List

func (b *ListBuilder) List() (*CSPCList, error)

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

func (*ListBuilder) WithFilter

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

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

type Predicate

type Predicate func(*CSPC) bool

Predicate defines an abstraction to determine conditional checks against the provided cspc 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 IsNil

func IsNil() Predicate

IsNil is predicate to filter out nil CSPC instances

type PredicateList

type PredicateList []Predicate

PredicateList holds a list of predicate

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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