v1alpha1

package
v1.12.1-RC1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 15, 2020 License: Apache-2.0 Imports: 13 Imported by: 11

Documentation

Index

Constants

View Source
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) HasAnnotationKey

func (bdc *BlockDeviceClaim) HasAnnotationKey(key string) bool

HasAnnotationKey return true if provided annotation key is present in the the provided BDC instance.

func (*BlockDeviceClaim) HasBD

func (bdc *BlockDeviceClaim) HasBD(bdName string) bool

HasBD return true if provided BD belongs to the BDC 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) (*ndm.BlockDeviceClaim, 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) GetBlockDeviceClaimFromBDName

func (bdcl *BlockDeviceClaimList) GetBlockDeviceClaimFromBDName(
	bdName string) (*apis.BlockDeviceClaim, error)

GetBlockDeviceClaimFromBDName return block device claim if claim exists for provided blockdevice name in claim list else return error

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

func (b *Builder) WithAnnotations(annotations map[string]string) *Builder

WithAnnotations appends or overwrites existing Annotations values of BDC with provided arguments

func (*Builder) WithAnnotationsNew

func (b *Builder) WithAnnotationsNew(annotations map[string]string) *Builder

WithAnnotationsNew sets the Annotations field of BDC with provided arguments

func (*Builder) WithBlockDeviceName

func (b *Builder) WithBlockDeviceName(bdName string) *Builder

WithBlockDeviceName sets the BlockDeviceName field of BDC provided arguments

func (*Builder) WithBlockDeviceTag

func (b *Builder) WithBlockDeviceTag(bdTagValue string) *Builder

WithBlockDeviceTag appends (or creates) the BDC Label Selector by setting the provided value to the fixed key openebs.io/block-device-tag This will enable the NDM to pick only devices that match the node (hostname) and block device tag value.

func (*Builder) WithBlockVolumeMode

func (b *Builder) WithBlockVolumeMode(mode corev1.PersistentVolumeMode) *Builder

WithBlockVolumeMode sets the volumeMode as volumeModeBlock, if persistentVolumeMode is set to "Block"

func (*Builder) WithCSPCOwnerReference

func (b *Builder) WithCSPCOwnerReference(cspc *apis.CStorPoolCluster) *Builder

WithCSPCOwnerReference sets the OwnerReference field in BDC with required fields

func (*Builder) WithCapacity

func (b *Builder) WithCapacity(capacity string) *Builder

WithCapacity sets the Capacity field in BDC with provided arguments

func (*Builder) WithConfigPath

func (b *Builder) WithConfigPath(configpath string) *Builder

WithConfigPath sets the path for k8s config

func (*Builder) WithDeviceType

func (b *Builder) WithDeviceType(dType string) *Builder

WithDeviceType sets the DeviceType field of BDC provided arguments

func (*Builder) WithFinalizer

func (b *Builder) WithFinalizer(finalizers ...string) *Builder

WithFinalizer sets the finalizer field in the BDC

func (*Builder) WithHostName

func (b *Builder) WithHostName(hName string) *Builder

WithHostName sets the hostName field of BDC provided arguments

func (*Builder) WithLabels

func (b *Builder) WithLabels(labels map[string]string) *Builder

WithLabels appends or overwrites existing Labels values of BDC with provided arguments

func (*Builder) WithLabelsNew

func (b *Builder) WithLabelsNew(labels map[string]string) *Builder

WithLabelsNew sets the Labels field of BDC with provided arguments

func (*Builder) WithName

func (b *Builder) WithName(name string) *Builder

WithName sets the Name field of BDC with provided value.

func (*Builder) WithNamespace

func (b *Builder) WithNamespace(namespace string) *Builder

WithNamespace sets the Namespace field of BDC provided arguments

func (*Builder) WithNodeName

func (b *Builder) WithNodeName(nName string) *Builder

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

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

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

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

func HasAnnotation(key, value string) Predicate

HasAnnotation is predicate to filter out based on annotation in BDC instances

func HasAnnotationKey

func HasAnnotationKey(key string) Predicate

HasAnnotationKey is predicate to filter out based on annotation key in BDC instances

func HasBD

func HasBD(bdName string) Predicate

HasBD is predicate to filter out based on BD.

func HasFinalizer

func HasFinalizer(finalizer string) Predicate

HasFinalizer is a predicate to filter out based on provided finalizer being present on the object.

func HasLabel

func HasLabel(key, value string) Predicate

HasLabel is predicate to filter out labeled BDC instances.

func IsStatus

func IsStatus(status string) Predicate

IsStatus is predicate to filter out BDC instances based on argument provided

type PredicateList

type PredicateList []Predicate

PredicateList holds the list of Predicates

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL