v1alpha3

package
v1.12.1-RC1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TemplateFunctions

func TemplateFunctions() template.FuncMap

TemplateFunctions exposes a few functions as go template functions.

Types

type Builder

type Builder struct {
	Csp *CSP
}

Builder is the builder object for CSP.

func BuilderForAPIObject

func BuilderForAPIObject(cspAPI *apis.CStorPool) *Builder

BuilderForAPIObject returns an instance of the Builder object based on csp api object

func BuilderForObject

func BuilderForObject(csp *CSP) *Builder

BuilderForObject returns an instance of the Builder object based on csp object.

func NewBuilder

func NewBuilder() *Builder

NewBuilder returns an empty instance of the Builder object.

type CSP

type CSP struct {
	// actual cstor pool object
	Object *apis.CStorPool
}

CSP encapsulates CStorPool api object.

type CSPList

type CSPList struct {
	// list of cstor pools
	ObjectList *apis.CStorPoolList
}

CSPList holds the list of StoragePoolClaim api.

func (*CSPList) Filter

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

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

func (*CSPList) GetPoolUIDs

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

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

func (*CSPList) Len

func (l *CSPList) Len() int

Len returns the length of the CSPList object

type Kubeclient

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

Kubeclient enables kubernetes API operations on cstor storage pool instance

func KubeClient

func KubeClient(opts ...KubeclientBuildOption) *Kubeclient

KubeClient returns a new instance of kubeclient meant for cstor volume replica operations

func (*Kubeclient) Delete

func (k *Kubeclient) Delete(name string, opts *metav1.DeleteOptions) (*apis.CStorPool, error)

Delete deletes a cstor pool instances present in kubernetes cluster

func (*Kubeclient) DeleteCollection

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

DeleteCollection deletes a collection of csp objects.

func (*Kubeclient) Get

func (k *Kubeclient) Get(
	name string,
	opts metav1.GetOptions,
) (*apis.CStorPool, error)

Get returns cstor pool instances present in kubernetes cluster

func (*Kubeclient) List

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

func (*Kubeclient) Patch

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

Patch patches a cstor pool instances present in kubernetes cluster

func (*Kubeclient) WithKubeConfigPath

func (k *Kubeclient) WithKubeConfigPath(kubeconfig string) (*Kubeclient, error)

WithKubeConfigPath sets the client using the kubeconfig path

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

type ListBuilder

type ListBuilder struct {
	CspList *CSPList
}

ListBuilder is the builder object for CSPList.

func ListBuilderForAPIObject

func ListBuilderForAPIObject(cspAPIList *apis.CStorPoolList) *ListBuilder

ListBuilderForAPIObject returns a new instance of ListBuilderForApiList object based on csp api list.

func ListBuilderForObject

func ListBuilderForObject(cspList *CSPList) *ListBuilder

ListBuilderForObject returns a new instance of ListBuilderForApiList object based on csp list.

func NewListBuilder

func NewListBuilder() *ListBuilder

NewListBuilder returns a new instance of ListBuilder Object.

func (*ListBuilder) List

func (b *ListBuilder) List() *CSPList

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

func (*ListBuilder) WithUIDNode

func (b *ListBuilder) WithUIDNode(UIDNode map[string]string) *ListBuilder

WithUIDNode builds a cspList based on the provided map of uid and nodename

func (*ListBuilder) WithUIDs

func (b *ListBuilder) WithUIDs(poolUIDs ...string) *ListBuilder

WithUIDs builds a list of cstor pools based on the provided pool UIDs

type Predicate

type Predicate func(*CSP) bool

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

func HasAnnotation

func HasAnnotation(key, value string) Predicate

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

func HasLabel

func HasLabel(key, value string) Predicate

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

func IsNotDeleted

func IsNotDeleted() Predicate

IsNotDeleted returns true if deletion timestamp was nil(which means object is not deleted) else return false i.e CSP is deleted

func IsNotUID

func IsNotUID(uids ...string) Predicate

IsNotUID returns true if provided csp instance's UID does not match with any of the provided UIDs

func IsStatus

func IsStatus(status string) Predicate

IsStatus returns true if the status on csp matches with provided status.

Jump to

Keyboard shortcuts

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