v1alpha1

package
v0.0.0-...-a88c85e Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

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 NewBuilder

func NewBuilder() *Builder

NewBuilder returns new instance of Builder

func (*Builder) Build

func (b *Builder) Build() (*corev1.PersistentVolumeClaim, error)

Build returns the PVC API instance

func (*Builder) WithAccessModes

func (b *Builder) WithAccessModes(accessMode []corev1.PersistentVolumeAccessMode) *Builder

WithAccessModes sets the AccessMode field in PVC with provided arguments

func (*Builder) WithAnnotations

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

WithAnnotations sets the Annotations field of PVC with provided arguments

func (*Builder) WithCapacity

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

WithCapacity sets the Capacity field in PVC with provided arguments

func (*Builder) WithGenerateName

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

WithGenerateName sets the GenerateName field of PVC with provided value

func (*Builder) WithLabels

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

WithLabels merges existing labels if any with the ones that are provided here

func (*Builder) WithLabelsNew

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

WithLabelsNew resets existing labels if any with ones that are provided here

func (*Builder) WithName

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

WithName sets the Name field of PVC with provided value.

func (*Builder) WithNamespace

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

WithNamespace sets the Namespace field of PVC provided arguments

func (*Builder) WithStorageClass

func (b *Builder) WithStorageClass(scName string) *Builder

WithStorageClass sets the StorageClass field of 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

Create creates a pvc in specified namespace in kubernetes cluster

func (*Kubeclient) CreateCollection

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

Get returns a pvc resource instances present in kubernetes cluster

func (*Kubeclient) List

List returns a list of pvc instances present in kubernetes cluster

func (*Kubeclient) Update

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

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

func (*PVC) IsBound

func (p *PVC) IsBound() bool

IsBound returns true if the pvc is bounded

func (*PVC) IsNil

func (p *PVC) IsNil() bool

IsNil returns true if the PVC instance is nil

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) Len

func (p *PVCList) Len() int

Len returns the number of items present in the PVCList

func (*PVCList) ToAPIList

func (p *PVCList) ToAPIList() *corev1.PersistentVolumeClaimList

ToAPIList converts PVCList to API PVCList

type Predicate

type Predicate func(*PVC) bool

Predicate defines an abstraction to determine conditional checks against the provided pvc instance

func ContainsName

func ContainsName(name string) Predicate

ContainsName is filter function to filter pvc's based on the name

func IsBound

func IsBound() Predicate

IsBound is a predicate to filter out pvcs which is bounded

func IsNil

func IsNil() Predicate

IsNil is predicate to filter out nil PVC instances

type PredicateList

type PredicateList []Predicate

PredicateList holds a list of predicate

Jump to

Keyboard shortcuts

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