Documentation ¶
Index ¶
- Constants
- type BlockDeviceClaim
- func (bdc *BlockDeviceClaim) AddFinalizer(finalizer string) (*ndm.BlockDeviceClaim, error)
- func (bdc *BlockDeviceClaim) GetHostName() string
- func (bdc *BlockDeviceClaim) GetNodeAtributesHostName() string
- func (bdc *BlockDeviceClaim) GetSpecHostName() string
- func (bdc *BlockDeviceClaim) HasAnnotation(key, value string) bool
- func (bdc *BlockDeviceClaim) HasFinalizer(finalizer string) bool
- func (bdc *BlockDeviceClaim) HasLabel(key, value string) bool
- func (bdc *BlockDeviceClaim) IsStatus(status string) bool
- func (bdc *BlockDeviceClaim) RemoveFinalizer(finalizer string) error
- type BlockDeviceClaimList
- type Builder
- func (b *Builder) Build() (*BlockDeviceClaim, error)
- func (b *Builder) WithAnnotations(annotations map[string]string) *Builder
- func (b *Builder) WithAnnotationsNew(annotations map[string]string) *Builder
- func (b *Builder) WithBlockDeviceName(bdName string) *Builder
- func (b *Builder) WithCSPCOwnerReference(cspc *apis.CStorPoolCluster) *Builder
- func (b *Builder) WithCapacity(capacity string) *Builder
- func (b *Builder) WithConfigPath(configpath string) *Builder
- func (b *Builder) WithDeviceType(dType string) *Builder
- func (b *Builder) WithFinalizer(finalizers ...string) *Builder
- func (b *Builder) WithHostName(hName 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) WithNodeName(nName string) *Builder
- func (b *Builder) WithOwnerReference(spc *apis.StoragePoolClaim) *Builder
- type Kubeclient
- func (k *Kubeclient) Create(bdc *apis.BlockDeviceClaim) (*apis.BlockDeviceClaim, 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.BlockDeviceClaim, error)
- func (k *Kubeclient) List(opts metav1.ListOptions) (*apis.BlockDeviceClaimList, error)
- func (k *Kubeclient) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (*apis.BlockDeviceClaim, error)
- func (k *Kubeclient) Update(bdc *apis.BlockDeviceClaim) (*apis.BlockDeviceClaim, 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 BlockDeviceClaim ¶
type BlockDeviceClaim struct { // actual block device claim object Object *ndm.BlockDeviceClaim // contains filtered or unexported fields }
BlockDeviceClaim encapsulates BlockDeviceClaim api object.
func (*BlockDeviceClaim) AddFinalizer ¶
func (bdc *BlockDeviceClaim) AddFinalizer(finalizer string) (*ndm.BlockDeviceClaim, error)
AddFinalizer adds the given finalizer to the object.
func (*BlockDeviceClaim) GetHostName ¶
func (bdc *BlockDeviceClaim) GetHostName() string
GetHostName return hostName from blockdeviceclaim
func (*BlockDeviceClaim) GetNodeAtributesHostName ¶
func (bdc *BlockDeviceClaim) GetNodeAtributesHostName() string
GetNodeAtributesHostName return hostName from blockdeviceclaim attribute hostName
func (*BlockDeviceClaim) GetSpecHostName ¶
func (bdc *BlockDeviceClaim) GetSpecHostName() string
GetSpecHostName return hostName from spec of blockdeviceclaim
func (*BlockDeviceClaim) HasAnnotation ¶
func (bdc *BlockDeviceClaim) HasAnnotation(key, value string) bool
HasAnnotation return true if provided annotation key and value are present in the the provided BDCList instance
func (*BlockDeviceClaim) HasFinalizer ¶
func (bdc *BlockDeviceClaim) HasFinalizer(finalizer string) bool
HasFinalizer returns true if the provided finalizer is present on the object.
func (*BlockDeviceClaim) HasLabel ¶
func (bdc *BlockDeviceClaim) HasLabel(key, value string) bool
HasLabel returns true if provided label key and value are present in the provided BDC(BlockDeviceClaim) instance
func (*BlockDeviceClaim) IsStatus ¶
func (bdc *BlockDeviceClaim) IsStatus(status string) bool
IsStatus returns true if the status on block device claim matches with provided status.
func (*BlockDeviceClaim) RemoveFinalizer ¶
func (bdc *BlockDeviceClaim) RemoveFinalizer(finalizer string) error
RemoveFinalizer removes the given finalizer from the object.
type BlockDeviceClaimList ¶
type BlockDeviceClaimList struct { // list of blockdeviceclaims ObjectList *ndm.BlockDeviceClaimList }
BlockDeviceClaimList encapsulates BlockDeviceClaimList api object
func (*BlockDeviceClaimList) GetBlockDeviceNamesByNode ¶
func (bdcl *BlockDeviceClaimList) GetBlockDeviceNamesByNode() map[string][]string
GetBlockDeviceNamesByNode returns map of node name and corresponding blockdevices to that node from blockdeviceclaim list
func (*BlockDeviceClaimList) Len ¶
func (bdcl *BlockDeviceClaimList) Len() int
Len returns the length og BlockDeviceClaimList.
type Builder ¶
type Builder struct { BDC *BlockDeviceClaim // contains filtered or unexported fields }
Builder is the builder object for BlockDeviceClaim
func BuilderForAPIObject ¶
func BuilderForAPIObject(bdc *ndm.BlockDeviceClaim) *Builder
BuilderForAPIObject returns an instance of the Builder object based on block device claim api object.
func BuilderForObject ¶
func BuilderForObject(BlockDeviceClaim *BlockDeviceClaim) *Builder
BuilderForObject returns an instance of the Builder object based on block device object
func NewBuilder ¶
func NewBuilder() *Builder
NewBuilder returns an empty instance of the Builder object
func (*Builder) Build ¶
func (b *Builder) Build() (*BlockDeviceClaim, error)
Build returns the BlockDeviceClaim instance
func (*Builder) WithAnnotations ¶
WithAnnotations appends or overwrites existing Annotations values of BDC with provided arguments
func (*Builder) WithAnnotationsNew ¶
WithAnnotationsNew sets the Annotations field of BDC with provided arguments
func (*Builder) WithBlockDeviceName ¶
WithBlockDeviceName sets the BlockDeviceName field of BDC provided arguments
func (*Builder) WithCSPCOwnerReference ¶
func (b *Builder) WithCSPCOwnerReference(cspc *apis.CStorPoolCluster) *Builder
WithCSPCOwnerReference sets the OwnerReference field in BDC with required fields
func (*Builder) WithCapacity ¶
WithCapacity sets the Capacity field in BDC with provided arguments
func (*Builder) WithConfigPath ¶
WithConfigPath sets the path for k8s config
func (*Builder) WithDeviceType ¶
WithDeviceType sets the DeviceType field of BDC provided arguments
func (*Builder) WithFinalizer ¶
WithFinalizer sets the finalizer field in the BDC
func (*Builder) WithHostName ¶
WithHostName sets the hostName field of BDC provided arguments
func (*Builder) WithLabels ¶
WithLabels appends or overwrites existing Labels values of BDC with provided arguments
func (*Builder) WithLabelsNew ¶
WithLabelsNew sets the Labels field of BDC with provided arguments
func (*Builder) WithNamespace ¶
WithNamespace sets the Namespace field of BDC provided arguments
func (*Builder) WithNodeName ¶
WithNodeName sets the node name field of BDC provided arguments
func (*Builder) WithOwnerReference ¶
func (b *Builder) WithOwnerReference(spc *apis.StoragePoolClaim) *Builder
WithOwnerReference sets the OwnerReference field in BDC with required fields
type Kubeclient ¶
type Kubeclient struct {
// contains filtered or unexported fields
}
Kubeclient enables kubernetes API operations on block device instance
func NewKubeClient ¶
func NewKubeClient(opts ...KubeclientBuildOption) *Kubeclient
NewKubeClient returns a new instance of kubeclient meant for block device operations
func (*Kubeclient) Create ¶
func (k *Kubeclient) Create(bdc *apis.BlockDeviceClaim) (*apis.BlockDeviceClaim, error)
Create creates a bdc in specified namespace in kubernetes cluster
func (*Kubeclient) Delete ¶
func (k *Kubeclient) Delete(name string, deleteOpts *metav1.DeleteOptions) error
Delete deletes a bdc instance from the kubecrnetes cluster
func (*Kubeclient) DeleteCollection ¶
func (k *Kubeclient) DeleteCollection(listOpts metav1.ListOptions, deleteOpts *metav1.DeleteOptions) error
DeleteCollection deletes a collection of bdc objects.
func (*Kubeclient) Get ¶
func (k *Kubeclient) Get(name string, opts metav1.GetOptions) (*apis.BlockDeviceClaim, error)
Get returns a disk object
func (*Kubeclient) List ¶
func (k *Kubeclient) List(opts metav1.ListOptions) (*apis.BlockDeviceClaimList, 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.BlockDeviceClaim, error)
Patch patches the block device claim if present in kubernetes cluster
func (*Kubeclient) Update ¶
func (k *Kubeclient) Update(bdc *apis.BlockDeviceClaim) (*apis.BlockDeviceClaim, error)
Update updates the block device claim 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 { BlockDeviceClaimList *BlockDeviceClaimList // contains filtered or unexported fields }
ListBuilder is the builder object for BlockDeviceClaimList
func ListBuilderFromAPIList ¶
func ListBuilderFromAPIList(bdcl *ndm.BlockDeviceClaimList) *ListBuilder
ListBuilderFromAPIList builds the list based on the provided APIBDC List
func ListBuilderFromList ¶
func ListBuilderFromList(bdcl *BlockDeviceClaimList) *ListBuilder
ListBuilderFromList builds the list based on the provided *BlockDeviceClaimList instances.
func NewListBuilder ¶
func NewListBuilder() *ListBuilder
NewListBuilder returns a new instance of ListBuilder object.
func (*ListBuilder) GetBlockDeviceClaim ¶
func (lb *ListBuilder) GetBlockDeviceClaim(bdcName string) *ndm.BlockDeviceClaim
GetBlockDeviceClaim returns block device claim object from existing ListBuilder
func (*ListBuilder) List ¶
func (lb *ListBuilder) List() *BlockDeviceClaimList
List returns the list of bdc instances that was built by this builder
func (*ListBuilder) WithFilter ¶
func (lb *ListBuilder) WithFilter(pred ...Predicate) *ListBuilder
WithFilter adds filters on which the bdc's has to be filtered
type Predicate ¶
type Predicate func(*BlockDeviceClaim) bool
Predicate defines an abstraction to determine conditional checks against the provided block device claim instance
func HasAnnotation ¶
HasAnnotation is predicate to filter out based on annotation in BDC instances
func HasFinalizer ¶
HasFinalizer is a predicate to filter out based on provided finalizer being present on the object.