Documentation ¶
Index ¶
- Constants
- type Builder
- func (b *Builder) Build() (*CSPC, error)
- func (b *Builder) GetObj() (*apisv1alpha1.CStorPoolCluster, error)
- func (b *Builder) WithGenerateName(name string) *Builder
- func (b *Builder) WithName(name string) *Builder
- func (b *Builder) WithNamespace(namespace string) *Builder
- func (b *Builder) WithPoolSpecBuilder(poolSpecBuilder *poolspec.Builder) *Builder
- type CSPC
- type CSPCList
- type Kubeclient
- func (k *Kubeclient) Create(cspc *apisv1alpha1.CStorPoolCluster) (*apisv1alpha1.CStorPoolCluster, 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) (*apisv1alpha1.CStorPoolCluster, error)
- func (k *Kubeclient) List(opts metav1.ListOptions) (*apisv1alpha1.CStorPoolClusterList, error)
- func (k *Kubeclient) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (*apisv1alpha1.CStorPoolCluster, error)
- func (k *Kubeclient) Update(cspc *apisv1alpha1.CStorPoolCluster) (*apisv1alpha1.CStorPoolCluster, error)
- func (k *Kubeclient) WithDefaults()
- func (k *Kubeclient) WithNamespace(namespace string) *Kubeclient
- type KubeclientBuildOption
- type ListBuilder
- type Predicate
- type PredicateList
Constants ¶
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 (*Builder) GetObj ¶
func (b *Builder) GetObj() (*apisv1alpha1.CStorPoolCluster, error)
GetObj returns the CSPC instance
func (*Builder) WithGenerateName ¶
WithGenerateName appends a random string after the name
func (*Builder) WithNamespace ¶
WithNamespace sets the Namespace field of CSPC with provided value.
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 ¶
HasFinalizer returns true if the provided finalizer is present on the object.
func (*CSPC) RemoveFinalizer ¶
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) 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 ¶
func (k *Kubeclient) Create(cspc *apisv1alpha1.CStorPoolCluster) (*apisv1alpha1.CStorPoolCluster, error)
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 ¶
func (k *Kubeclient) Get(name string, opts metav1.GetOptions) (*apisv1alpha1.CStorPoolCluster, error)
Get returns a disk object
func (*Kubeclient) List ¶
func (k *Kubeclient) List(opts metav1.ListOptions) (*apisv1alpha1.CStorPoolClusterList, 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) (*apisv1alpha1.CStorPoolCluster, error)
Patch patches the CStorPoolCluster claim if present in kubernetes cluster
func (*Kubeclient) Update ¶
func (k *Kubeclient) Update(cspc *apisv1alpha1.CStorPoolCluster) (*apisv1alpha1.CStorPoolCluster, error)
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 ¶
func (b *ListBuilder) APIList() (*apisv1alpha1.CStorPoolClusterList, error)
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 ¶
Predicate defines an abstraction to determine conditional checks against the provided cspc instance
func HasFinalizer ¶
HasFinalizer is a predicate to filter out based on provided finalizer being present on the object.