Documentation ¶
Index ¶
- func TemplateFunctions() template.FuncMap
- type Builder
- type CSP
- type CSPList
- type Kubeclient
- func (k *Kubeclient) Delete(name string, opts *metav1.DeleteOptions) (*apis.CStorPool, error)
- func (k *Kubeclient) DeleteCollection(listOpts metav1.ListOptions, deleteOpts *metav1.DeleteOptions) error
- func (k *Kubeclient) Get(name string, opts metav1.GetOptions) (*apis.CStorPool, error)
- func (k *Kubeclient) List(opts metav1.ListOptions) (*apis.CStorPoolList, error)
- func (k *Kubeclient) Patch(name string, pt types.PatchType, data []byte) (*apis.CStorPool, error)
- func (k *Kubeclient) WithKubeConfigPath(kubeconfig string) (*Kubeclient, error)
- type KubeclientBuildOption
- type ListBuilder
- type Predicate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TemplateFunctions ¶
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 ¶
BuilderForAPIObject returns an instance of the Builder object based on csp api object
func BuilderForObject ¶
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 CSPList ¶
type CSPList struct { // list of cstor pools ObjectList *apis.CStorPoolList }
CSPList holds the list of StoragePoolClaim api.
func (*CSPList) Filter ¶
Filter will filter the csp instances if all the predicates succeed against that csp.
func (*CSPList) GetPoolUIDs ¶
GetPoolUIDs retuns the UIDs of the pools available in the list.
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 ¶
func (k *Kubeclient) List(opts metav1.ListOptions) (*apis.CStorPoolList, error)
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 ¶
Predicate defines an abstraction to determine conditional checks against the provided csp instance
func HasAnnotation ¶
HasAnnotation returns true if provided annotation key and value are present in the provided CSP instance
func HasLabel ¶
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