Documentation ¶
Index ¶
- Constants
- type Builder
- func (b *Builder) Build() (*CSPI, error)
- func (b *Builder) WithAnnotations(annotations map[string]string) *Builder
- func (b *Builder) WithAnnotationsNew(annotations map[string]string) *Builder
- func (b *Builder) WithCSPCOwnerReference(cspic *apis.CStorPoolCluster) *Builder
- func (b *Builder) WithDependentsUpgraded() *Builder
- func (b *Builder) WithFinalizer(finalizers ...string) *Builder
- func (b *Builder) WithLabels(labels map[string]string) *Builder
- func (b *Builder) WithLabelsNew(labels map[string]string) *Builder
- func (b *Builder) WithName(name string) *Builder
- func (b *Builder) WithNamespace(namespace string) *Builder
- func (b *Builder) WithNewVersion(version string) *Builder
- func (b *Builder) WithNodeName(nodeName string) *Builder
- func (b *Builder) WithNodeSelectorByReference(nodeSelector map[string]string) *Builder
- func (b *Builder) WithOwnerReference(spc *apis.StoragePoolClaim) *Builder
- func (b *Builder) WithPoolConfig(poolConfig *apis.PoolConfig) *Builder
- func (b *Builder) WithRaidGroups(raidGroup []apis.RaidGroup) *Builder
- type CSPI
- type CSPIList
- type Kubeclient
- func (k *Kubeclient) Create(cspi *apis.CStorPoolInstance) (*apis.CStorPoolInstance, error)
- func (k *Kubeclient) Delete(name string, deleteOpts *metav1.DeleteOptions) error
- func (k *Kubeclient) DeleteCollection(listOpts metav1.ListOptions, deleteOpts *metav1.DeleteOptions) error
- func (k *Kubeclient) Get(name string, opts metav1.GetOptions) (*apis.CStorPoolInstance, error)
- func (k *Kubeclient) List(opts metav1.ListOptions) (*apis.CStorPoolInstanceList, error)
- func (k *Kubeclient) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (*apis.CStorPoolInstance, error)
- func (k *Kubeclient) Update(cspi *apis.CStorPoolInstance) (*apis.CStorPoolInstance, error)
- func (k *Kubeclient) WithDefaults()
- func (k *Kubeclient) WithNamespace(namespace string) *Kubeclient
- type KubeclientBuildOption
- type ListBuilder
- type Predicate
- type PredicateList
Constants ¶
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 ¶
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) WithAnnotations ¶
WithAnnotations appends or overwrites existing Annotations values of CSPI with provided arguments
func (*Builder) WithAnnotationsNew ¶
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 ¶
WithDependentsUpgraded sets the field to true for new CSPI
func (*Builder) WithFinalizer ¶
WithFinalizer sets the finalizer field in the BDC
func (*Builder) WithLabels ¶
WithLabels appends or overwrites existing Labels values of CSPI with provided arguments
func (*Builder) WithLabelsNew ¶
WithLabelsNew sets the Labels field of CSPI with provided arguments
func (*Builder) WithNamespace ¶
WithNamespace sets the Namespace field of CSPI provided arguments
func (*Builder) WithNewVersion ¶
WithNewVersion sets the current and desired version field of CSPI with provided arguments
func (*Builder) WithNodeName ¶
WithNodeName sets the HostName field of CSPI with the provided argument.
func (*Builder) WithNodeSelectorByReference ¶
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.
type CSPI ¶
type CSPI struct { // actual CSPI object Object *apis.CStorPoolInstance }
CSPI encapsulates CStorPoolInstance api object.
func (*CSPI) HasAnnotation ¶
HasAnnotation return true if provided annotation key and value are present in the the provided CSPIList instance
func (*CSPI) HasLabel ¶
HasLabel returns true if provided label key and value are present in the provided CSPI
func (*CSPI) HasNodeName ¶
HasNodeName returns true if the CSPI belongs to the provided node name.
type CSPIList ¶
type CSPIList struct { // list of CSPIs ObjectList *apis.CStorPoolInstanceList }
CSPIList encapsulates CStorPoolList api object
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 ¶
func (k *Kubeclient) Create(cspi *apis.CStorPoolInstance) (*apis.CStorPoolInstance, error)
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 ¶
func (k *Kubeclient) Get(name string, opts metav1.GetOptions) (*apis.CStorPoolInstance, error)
Get returns a disk object
func (*Kubeclient) List ¶
func (k *Kubeclient) List(opts metav1.ListOptions) (*apis.CStorPoolInstanceList, error)
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 ¶
func (k *Kubeclient) Update(cspi *apis.CStorPoolInstance) (*apis.CStorPoolInstance, error)
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 ¶
Predicate defines an abstraction to determine conditional checks against the provided CStorPoolInstance
func HasAnnotation ¶
HasAnnotation is predicate to filter out based on annotation in CSPI instances
func HasNodeName ¶
HasNodeName is predicate to filter out based on node name of CSPI instances.