Documentation ¶
Index ¶
- Constants
- func HasAnnotation(key, value string) predicate
- func IsNotUID(uids ...string) predicate
- func ListBuilder() *listBuilder
- func TemplateFunctions() template.FuncMap
- type CSP
- func (c *CSP) GetCapacityThreshold() int
- func (c *CSP) GetTotalUsableCapacityWithThreshold() (resource.Quantity, error)
- func (c *CSP) HasSpace(incomingVolCap, capacityUsedByExistingVols resource.Quantity) bool
- func (c *CSP) UsableFreeCapacityOnCSP(capacityUsedByExistingVols resource.Quantity) (resource.Quantity, error)
- type CSPList
- type Kubeclient
- func (k *Kubeclient) Create(obj *apis.CStorPool) (*apis.CStorPool, error)
- func (k *Kubeclient) Delete(name string, opts *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, patchObj []byte) (*apis.CStorPool, error)
- type KubeclientBuildOption
Constants ¶
const ( // PoolCapacityThresholdPercentage is the threshold percentage for usable pool size. // Example: // If pool size is 100 Gi and threshold percentae is 70 then // 70 Gi is the usable pool capacity. PoolCapacityThresholdPercentage = 70 )
Variables ¶
This section is empty.
Functions ¶
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 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 ListBuilder ¶
func ListBuilder() *listBuilder
ListBuilder returns a new instance of listBuilder Object
func TemplateFunctions ¶
TemplateFunctions exposes a few functions as go template functions
Types ¶
type CSP ¶
CSP encapsulates the CStorPool API object.
func (*CSP) GetCapacityThreshold ¶
GetCapacityThreshold returns the capacity threshold. Example : If pool size is 100 Gi and capacity threshold is 70 % then the effective size of pool is 70 Gi for accommodating volumes.
func (*CSP) GetTotalUsableCapacityWithThreshold ¶
GetTotalUsableCapacityWithThreshold returns the usable capacity on pool. Example: If TotalUsableCapacityWithThreshold is 70 Gi than it is possible that some amount of space is already being used by some other existing volumes.
func (*CSP) HasSpace ¶
HasSpace returns true if the CSP has free space to accomodate the incoming volume.
func (*CSP) UsableFreeCapacityOnCSP ¶
func (c *CSP) UsableFreeCapacityOnCSP(capacityUsedByExistingVols resource.Quantity) (resource.Quantity, error)
UsableFreeCapacityOnCSP returns the total usable free capacity present on the CSP. Example: If UsableFreeCapacityOnCSP is 30 Gi than the pool (CSP) can accomodate any volume of size less than(or equal to) 30 Gi
type CSPList ¶
type CSPList struct { // list of cstor pools Items []*CSP }
CSPList holds the list of cstorpools
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 CStorPool instance
func NewKubeClient ¶
func NewKubeClient(opts ...KubeclientBuildOption) *Kubeclient
NewKubeClient returns a new instance of kubeclient meant for CStorPool related operations
func (*Kubeclient) Delete ¶
func (k *Kubeclient) Delete(name string, opts *metav1.DeleteOptions) error
Delete deletes CStorPool instance
func (*Kubeclient) Get ¶
func (k *Kubeclient) Get(name string, opts metav1.GetOptions) (*apis.CStorPool, error)
Get returns an CStorPool instance from kubernetes cluster
func (*Kubeclient) List ¶
func (k *Kubeclient) List(opts metav1.ListOptions) (*apis.CStorPoolList, error)
List returns a list of CStorPool instances present in kubernetes cluster
type KubeclientBuildOption ¶
type KubeclientBuildOption func(*Kubeclient)
KubeclientBuildOption defines the abstraction to build a Kubeclient instance
func WithClientset ¶
func WithClientset(c *clientset.Clientset) KubeclientBuildOption
WithClientset sets the kubernetes clientset against the kubeclient instance