v1alpha1

package
v1.11.0-RC1 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2020 License: Apache-2.0 Imports: 7 Imported by: 5

Documentation

Index

Constants

View Source
const (

	// CStorVolumeReplicaFinalizer is the name of finalizer on CStorVolumeClaim
	CStorVolumeReplicaFinalizer = "cstorvolumereplica.openebs.io/finalizer"
)

Variables

This section is empty.

Functions

func GetCVRList

func GetCVRList(pvName, namespace string) (*apis.CStorVolumeReplicaList, error)

GetCVRList returns list of volume replicas related to provided volume

func GetPoolNames

func GetPoolNames(cvrList *apis.CStorVolumeReplicaList) []string

GetPoolNames returns list of pool names from cStor volume replcia list

func GetVolumeReplicaPoolNames

func GetVolumeReplicaPoolNames(pvName, namespace string) ([]string, error)

GetVolumeReplicaPoolNames return list of replicas pool names by taking pvName and namespace(where pool is installed) as a input and return error(if any error occured)

Types

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

Builder is the builder object for CStorVolume

func NewBuilder

func NewBuilder() *Builder

NewBuilder returns new instance of Builder

func (*Builder) Build

func (b *Builder) Build() (*apis.CStorVolumeReplica, error)

Build returns the CStorVolumeReplica API instance

func (*Builder) WithAnnotations

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

WithAnnotations merges existing annotations if any with the ones that are provided here

func (*Builder) WithAnnotationsNew

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

WithAnnotationsNew resets existing annotations if any with ones that are provided here

func (*Builder) WithCapacity

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

WithCapacity sets the Capacity field of CStorVolumeReplica with provided arguments

func (*Builder) WithDependentsUpgraded

func (b *Builder) WithDependentsUpgraded() *Builder

WithDependentsUpgraded sets the field to true for new volume

func (*Builder) WithFinalizers

func (b *Builder) WithFinalizers(finalizers []string) *Builder

WithFinalizers merges the existing finalizers if any with the ones provided arguments

func (*Builder) WithFinalizersNew

func (b *Builder) WithFinalizersNew(finalizers []string) *Builder

WithFinalizersNew resets any existing finalizers and overrides them with provided arguments

func (*Builder) WithGenerateName

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

WithGenerateName sets the GenerateName field of CStorVolumeReplica 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 CStorVolumeReplica with provided value.

func (*Builder) WithNamespace

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

WithNamespace sets the Namespace field of CStorVolumeReplica provided arguments

func (*Builder) WithNewVersion

func (b *Builder) WithNewVersion(version string) *Builder

WithNewVersion sets the current and desired version field of CStorVolumeReplica with provided arguments

func (*Builder) WithOwnerRefernceNew

func (b *Builder) WithOwnerRefernceNew(ownerRefernce []metav1.OwnerReference) *Builder

WithOwnerRefernceNew sets ownerrefernce if any with ones that are provided here

func (*Builder) WithReplicaID

func (b *Builder) WithReplicaID(replicaID string) *Builder

WithReplicaID sets the replicaID with the provided argumentsu

func (*Builder) WithStatusPhase

func (b *Builder) WithStatusPhase(phase apis.CStorVolumeReplicaPhase) *Builder

WithStatusPhase sets the Status Phase of CStorVolumeReplica with provided arguments

func (*Builder) WithTargetIP

func (b *Builder) WithTargetIP(targetip string) *Builder

WithTargetIP sets the target IP address field of CStorVolumeReplica with provided arguments

type CVR

type CVR struct {
	// contains filtered or unexported fields
}

CVR is a wrapper for cstorvolume replica object

func (*CVR) HasLabel

func (p *CVR) HasLabel(key, value string) bool

HasLabel returns true only if label key value matched to provided value.

func (*CVR) IsErrored

func (p *CVR) IsErrored() bool

IsErrored returns true if the CVR is in Error state

func (*CVR) IsHealthy

func (p *CVR) IsHealthy() bool

IsHealthy returns true if the CVR is in healthy state

type CVRList

type CVRList struct {
	// contains filtered or unexported fields
}

CVRList is a list of cstorvolume replica objects

func (*CVRList) GetPoolNames

func (l *CVRList) GetPoolNames() []string

GetPoolNames returns a list of cstor pool name corresponding to cstor volume replica instances

func (*CVRList) GetPoolUIDs

func (l *CVRList) GetPoolUIDs() []string

GetPoolUIDs returns a list of cstor pool UIDs corresponding to cstor volume replica instances

func (*CVRList) GetUniquePoolNames

func (l *CVRList) GetUniquePoolNames() []string

GetUniquePoolNames returns a list of cstor pool name corresponding to cstor volume replica instances

func (*CVRList) Len

func (l *CVRList) Len() int

Len returns the number of items present in the CVRList

type Kubeclient

type Kubeclient struct {
	// contains filtered or unexported fields
}

Kubeclient enables kubernetes API operations on cstor volume replica 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 cstorvolumereplica resource for given object

func (*Kubeclient) Delete

func (k *Kubeclient) Delete(name string) error

Delete delete the cstorvolume replica resource

func (*Kubeclient) Get

func (k *Kubeclient) Get(
	name string,
	opts metav1.GetOptions,
) (*apis.CStorVolumeReplica, error)

Get returns cstorvolumereplica object for given name

func (*Kubeclient) List

List returns a list of cstor volume replica instances present in kubernetes cluster

func (*Kubeclient) Patch

func (k *Kubeclient) Patch(
	name, namespace string,
	pt types.PatchType,
	data []byte,
) (*apis.CStorVolumeReplica, error)

Patch patches the cstorvolume replica resource

func (*Kubeclient) Update

Update updates cstorvolumereplica resource for given object

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 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(path string) KubeclientBuildOption

WithKubeConfigPath sets the kubernetes client against the provided path

func WithNamespace

func WithNamespace(namespace string) KubeclientBuildOption

WithNamespace sets the kubernetes client against the provided namespace

type ListBuilder

type ListBuilder struct {
	// contains filtered or unexported fields
}

ListBuilder enables building an instance of CVRList

func NewListBuilder

func NewListBuilder() *ListBuilder

NewListBuilder returns a new instance of ListBuilder

func (*ListBuilder) AppendListBuilder

func (b *ListBuilder) AppendListBuilder(
	cvr *apis.CStorVolumeReplica) *ListBuilder

AppendListBuilder append the provided CVR API object into existing ListBuilder

func (*ListBuilder) List

func (b *ListBuilder) List() *CVRList

List returns the list of cvr instances that was built by this builder

func (*ListBuilder) WithAPIList

func (b *ListBuilder) WithAPIList(
	list *apis.CStorVolumeReplicaList,
) *ListBuilder

WithAPIList builds the list of cvr instances based on the provided cvr api instances

func (*ListBuilder) WithFilter

func (b *ListBuilder) WithFilter(pred ...Predicate) *ListBuilder

WithFilter adds filters on which the cvr's has to be filtered

type Predicate

type Predicate func(*CVR) bool

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

func HasLabel

func HasLabel(key, value string) Predicate

HasLabel returns predicate to filter out CVRs based on the provided key and values

func IsErrored

func IsErrored() Predicate

IsErrored is a Predicate to filter out cvrs which is in errored state

func IsHealthy

func IsHealthy() Predicate

IsHealthy is a Predicate to filter out cvrs which is healthy

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