Documentation ¶
Index ¶
- type Builder
- func (b *Builder) Build() (*corev1.PersistentVolumeClaim, error)
- func (b *Builder) WithAccessModeRWO() *Builder
- func (b *Builder) WithAccessModes(accessMode []corev1.PersistentVolumeAccessMode) *Builder
- func (b *Builder) WithAnnotations(annotations map[string]string) *Builder
- func (b *Builder) WithCapacity(capacity string) *Builder
- func (b *Builder) WithGenerateName(name 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) WithStorageClass(scName string) *Builder
- func (b *Builder) WithVolumeMode(vM corev1.PersistentVolumeMode) *Builder
- func (b *Builder) WithVolumeName(volumeName string) *Builder
- type Kubeclient
- func (k *Kubeclient) Create(pvc *corev1.PersistentVolumeClaim) (*corev1.PersistentVolumeClaim, error)
- func (k *Kubeclient) CreateCollection(list *corev1.PersistentVolumeClaimList) (*corev1.PersistentVolumeClaimList, 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) (*corev1.PersistentVolumeClaim, error)
- func (k *Kubeclient) List(opts metav1.ListOptions) (*corev1.PersistentVolumeClaimList, error)
- func (k *Kubeclient) Update(pvc *corev1.PersistentVolumeClaim) (*corev1.PersistentVolumeClaim, error)
- func (k *Kubeclient) WithNamespace(namespace string) *Kubeclient
- type KubeclientBuildOption
- type ListBuilder
- type PVC
- type PVCList
- type Predicate
- type PredicateList
Constants ¶
This section is empty.
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 PVC
func BuildFrom ¶
func BuildFrom(pvc *corev1.PersistentVolumeClaim) *Builder
BuildFrom returns new instance of Builder from the provided api instance
func (*Builder) Build ¶
func (b *Builder) Build() (*corev1.PersistentVolumeClaim, error)
Build returns the PVC API instance
func (*Builder) WithAccessModeRWO ¶
WithAccessModeRWO sets the AccessMode field in PVC with Read-Write-Once
func (*Builder) WithAccessModes ¶
func (b *Builder) WithAccessModes(accessMode []corev1.PersistentVolumeAccessMode) *Builder
WithAccessModes sets the AccessMode field in PVC with provided arguments
func (*Builder) WithAnnotations ¶
WithAnnotations sets the Annotations field of PVC with provided arguments
func (*Builder) WithCapacity ¶
WithCapacity sets the Capacity field in PVC with provided arguments
func (*Builder) WithGenerateName ¶
WithGenerateName sets the GenerateName field of PVC with provided value
func (*Builder) WithLabels ¶
WithLabels merges existing labels if any with the ones that are provided here
func (*Builder) WithLabelsNew ¶
WithLabelsNew resets existing labels if any with ones that are provided here
func (*Builder) WithNamespace ¶
WithNamespace sets the Namespace field of PVC provided arguments
func (*Builder) WithStorageClass ¶
WithStorageClass sets the StorageClass field of PVC with provided arguments
func (*Builder) WithVolumeMode ¶
func (b *Builder) WithVolumeMode(vM corev1.PersistentVolumeMode) *Builder
WithVolumeMode sets the volumeMode field in PVC with provided arguments
func (*Builder) WithVolumeName ¶ added in v0.6.0
WithVolumeName sets the volumeName field in PVC with provided arguments
type Kubeclient ¶
type Kubeclient struct {
// contains filtered or unexported fields
}
Kubeclient enables kubernetes API operations on pvc instance
func NewKubeClient ¶
func NewKubeClient(opts ...KubeclientBuildOption) *Kubeclient
NewKubeClient returns a new instance of kubeclient meant for cstor volume replica operations
func (*Kubeclient) Create ¶
func (k *Kubeclient) Create(pvc *corev1.PersistentVolumeClaim) (*corev1.PersistentVolumeClaim, error)
Create creates a pvc in specified namespace in kubernetes cluster
func (*Kubeclient) CreateCollection ¶
func (k *Kubeclient) CreateCollection( list *corev1.PersistentVolumeClaimList, ) (*corev1.PersistentVolumeClaimList, error)
CreateCollection creates a list of pvcs in specified namespace in kubernetes cluster
func (*Kubeclient) Delete ¶
func (k *Kubeclient) Delete(name string, deleteOpts *metav1.DeleteOptions) error
Delete deletes a pvc instance from the kubecrnetes cluster
func (*Kubeclient) DeleteCollection ¶
func (k *Kubeclient) DeleteCollection(listOpts metav1.ListOptions, deleteOpts *metav1.DeleteOptions) error
DeleteCollection deletes a collection of pvc objects.
func (*Kubeclient) Get ¶
func (k *Kubeclient) Get(name string, opts metav1.GetOptions) (*corev1.PersistentVolumeClaim, error)
Get returns a pvc resource instances present in kubernetes cluster
func (*Kubeclient) List ¶
func (k *Kubeclient) List(opts metav1.ListOptions) (*corev1.PersistentVolumeClaimList, error)
List returns a list of pvc instances present in kubernetes cluster
func (*Kubeclient) Update ¶
func (k *Kubeclient) Update(pvc *corev1.PersistentVolumeClaim) (*corev1.PersistentVolumeClaim, error)
Update updates a pvc in specified namespace in kubernetes cluster
func (*Kubeclient) WithNamespace ¶
func (k *Kubeclient) WithNamespace(namespace string) *Kubeclient
WithNamespace sets the kubernetes client against the provided namespace
type KubeclientBuildOption ¶
type KubeclientBuildOption func(*Kubeclient)
KubeclientBuildOption abstracts creating an instance of kubeclient
func WithClientSet ¶
func WithClientSet(c *kubernetes.Clientset) KubeclientBuildOption
WithClientSet sets the kubernetes client against the kubeclient instance
func WithKubeConfigPath ¶
func WithKubeConfigPath(path 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 PVCList
func ListBuilderForAPIObjects ¶
func ListBuilderForAPIObjects(pvcs *corev1.PersistentVolumeClaimList) *ListBuilder
ListBuilderForAPIObjects returns a new instance of ListBuilder based on provided api pvc list
func ListBuilderForObjects ¶
func ListBuilderForObjects(pvcs *PVCList) *ListBuilder
ListBuilderForObjects returns a new instance of ListBuilder based on provided pvc list
func ListBuilderFromTemplate ¶
func ListBuilderFromTemplate(pvc *corev1.PersistentVolumeClaim) *ListBuilder
ListBuilderFromTemplate returns a new instance of ListBuilder based on the provided pvc template
func NewListBuilder ¶
func NewListBuilder() *ListBuilder
NewListBuilder returns an instance of ListBuilder
func (*ListBuilder) APIList ¶
func (b *ListBuilder) APIList() (*corev1.PersistentVolumeClaimList, error)
APIList builds core API PVC list using listbuilder
func (*ListBuilder) Len ¶
func (b *ListBuilder) Len() (int, error)
Len returns the number of items present in the PVCList of a builder
func (*ListBuilder) List ¶
func (b *ListBuilder) List() (*PVCList, error)
List returns the list of pvc instances that was built by this builder
func (*ListBuilder) WithCount ¶
func (b *ListBuilder) WithCount(count int) *ListBuilder
WithCount sets the count that determines the number of pvcs to be built
func (*ListBuilder) WithFilter ¶
func (b *ListBuilder) WithFilter(pred ...Predicate) *ListBuilder
WithFilter adds filters on which the pvcs are filtered
type PVC ¶
type PVC struct {
// contains filtered or unexported fields
}
PVC is a wrapper over persistentvolumeclaim api object. It provides build, validations and other common logic to be used by various feature specific callers.
func NewForAPIObject ¶
func NewForAPIObject(obj *corev1.PersistentVolumeClaim, opts ...pvcBuildOption) *PVC
NewForAPIObject returns a new instance of PVC
type PVCList ¶
type PVCList struct {
// contains filtered or unexported fields
}
PVCList is a wrapper over persistentvolumeclaim api object. It provides build, validations and other common logic to be used by various feature specific callers.
func (*PVCList) ToAPIList ¶
func (p *PVCList) ToAPIList() *corev1.PersistentVolumeClaimList
ToAPIList converts PVCList to API PVCList
type Predicate ¶
Predicate defines an abstraction to determine conditional checks against the provided pvc instance
func ContainsName ¶
ContainsName is filter function to filter pvc's based on the name