Documentation ¶
Index ¶
- Constants
- func GetResizeCondition() apis.CStorVolumeCondition
- type Builder
- func (b *Builder) Build() (*apis.CStorVolume, error)
- func (b *Builder) WithAnnotations(annotations map[string]string) *Builder
- func (b *Builder) WithAnnotationsNew(annotations map[string]string) *Builder
- func (b *Builder) WithCStorIQN(name string) *Builder
- func (b *Builder) WithCapacity(capacity string) *Builder
- func (b *Builder) WithConsistencyFactor(consistencyfactor int) *Builder
- func (b *Builder) WithGenerateName(name string) *Builder
- func (b *Builder) WithIQN(iqn 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) WithNodeBase(nodebase string) *Builder
- func (b *Builder) WithOwnerRefernceNew(ownerRefernce []metav1.OwnerReference) *Builder
- func (b *Builder) WithReplicationFactor(replicationfactor int) *Builder
- func (b *Builder) WithTargetIP(targetip string) *Builder
- func (b *Builder) WithTargetPort(targetport string) *Builder
- func (b *Builder) WithTargetPortal(targetportal string) *Builder
- type CStorVolume
- type CStorVolumeList
- type Conditions
- type Kubeclient
- func (k *Kubeclient) Create(vol *apis.CStorVolume) (*apis.CStorVolume, error)
- func (k *Kubeclient) Delete(name string) error
- func (k *Kubeclient) Get(name string, opts metav1.GetOptions) (*apis.CStorVolume, error)
- func (k *Kubeclient) GetRaw(name string, opts metav1.GetOptions) ([]byte, error)
- func (k *Kubeclient) List(opts metav1.ListOptions) (*apis.CStorVolumeList, error)
- func (k *Kubeclient) Patch(name, namespace string, pt types.PatchType, data []byte) (*apis.CStorVolume, error)
- func (k *Kubeclient) WithNamespace(namespace string) *Kubeclient
- type KubeclientBuildOption
- type ListBuilder
- type Predicate
- type PredicateList
Constants ¶
const ( //CStorNodeBase nodeBase for cstor volume CStorNodeBase string = "iqn.2016-09.com.openebs.cstor" // TargetPort is port for cstor volume TargetPort string = "3260" )
const ( //IoWaitTime is the time interval for which the IO has to be stopped before doing snapshot operation IoWaitTime = 10 //TotalWaitTime is the max time duration to wait for doing snapshot operation on all the replicas TotalWaitTime = 60 )
Variables ¶
This section is empty.
Functions ¶
func GetResizeCondition ¶
func GetResizeCondition() apis.CStorVolumeCondition
GetResizeCondition will return resize condtion related to cstorvolume condtions
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder is the builder object for CStorVolume
func BuilderFromAPI ¶
func BuilderFromAPI(cStorVolume *apis.CStorVolume) *Builder
BuilderFromAPI returns builder instance from core API
func (*Builder) Build ¶
func (b *Builder) Build() (*apis.CStorVolume, error)
Build returns the CStorVolume API instance
func (*Builder) WithAnnotations ¶
WithAnnotations merges existing annotations if any with the ones that are provided here
func (*Builder) WithAnnotationsNew ¶
WithAnnotationsNew resets existing annotations if any with ones that are provided here
func (*Builder) WithCStorIQN ¶
WithCStorIQN sets the iqn field of CStorVolume with provided arguments
func (*Builder) WithCapacity ¶
WithCapacity sets the Capacity field of CStorVolume with provided arguments
func (*Builder) WithConsistencyFactor ¶
WithConsistencyFactor sets the ConsistencyFactor field of CStorVolume with provided arguments
func (*Builder) WithGenerateName ¶
WithGenerateName sets the GenerateName field of CStorVolume 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 CStorVolume provided arguments
func (*Builder) WithNodeBase ¶
WithNodeBase sets the NodeBase field of CStorVolume 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) WithReplicationFactor ¶
WithReplicationFactor sets the ReplicationFactor field of CStorVolume with provided arguments
func (*Builder) WithTargetIP ¶
WithTargetIP sets the target IP address field of CStorVolume with provided arguments
func (*Builder) WithTargetPort ¶
WithTargetPort sets the TargetPort field of CStorVolume with provided arguments
func (*Builder) WithTargetPortal ¶
WithTargetPortal sets the TargetPortal field of CStorVolume with provided arguments
type CStorVolume ¶
type CStorVolume struct {
// contains filtered or unexported fields
}
CStorVolume a wrapper for CStorVolume object
func NewForAPIObject ¶
func NewForAPIObject(obj *apis.CStorVolume) *CStorVolume
NewForAPIObject returns a new instance of cstorvolume
func (*CStorVolume) GetCVCondition ¶
func (c *CStorVolume) GetCVCondition( condType apis.CStorVolumeConditionType) apis.CStorVolumeCondition
GetCVCondition returns corresponding cstorvolume condition based argument passed
func (*CStorVolume) IsConditionPresent ¶
func (c *CStorVolume) IsConditionPresent(condType apis.CStorVolumeConditionType) bool
IsConditionPresent returns true if condition is available
func (*CStorVolume) IsHealthy ¶
func (c *CStorVolume) IsHealthy() bool
IsHealthy returns true if the CVR is in healthy state
func (*CStorVolume) IsResizePending ¶
func (c *CStorVolume) IsResizePending() bool
IsResizePending return true if resize is in progress
type CStorVolumeList ¶
type CStorVolumeList struct {
// contains filtered or unexported fields
}
CStorVolumeList is a list of cstorvolume objects
func (*CStorVolumeList) Len ¶
func (l *CStorVolumeList) Len() int
Len returns the number of items present in the CStorVolumeList
type Conditions ¶
type Conditions []apis.CStorVolumeCondition
Conditions enables building CRUD operations on cstorvolume conditions
func (Conditions) AddCondition ¶
func (c Conditions) AddCondition(cond apis.CStorVolumeCondition) []apis.CStorVolumeCondition
AddCondition appends the new condition to existing conditions
func (Conditions) DeleteCondition ¶
func (c Conditions) DeleteCondition(cond apis.CStorVolumeCondition) []apis.CStorVolumeCondition
DeleteCondition deletes the condition from conditions
func (Conditions) UpdateCondition ¶
func (c Conditions) UpdateCondition(cond apis.CStorVolumeCondition) []apis.CStorVolumeCondition
UpdateCondition updates the condition if it is present in Conditions
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 ¶
func (k *Kubeclient) Create(vol *apis.CStorVolume) (*apis.CStorVolume, error)
Create creates the cstorvolume resource
func (*Kubeclient) Delete ¶
func (k *Kubeclient) Delete(name string) error
Delete deletes the cstorvolume resource
func (*Kubeclient) Get ¶
func (k *Kubeclient) Get( name string, opts metav1.GetOptions, ) (*apis.CStorVolume, error)
Get returns deployment object for given name
func (*Kubeclient) GetRaw ¶
func (k *Kubeclient) GetRaw( name string, opts metav1.GetOptions, ) ([]byte, error)
GetRaw returns a raw CStor volume instance
func (*Kubeclient) List ¶
func (k *Kubeclient) List( opts metav1.ListOptions, ) (*apis.CStorVolumeList, error)
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.CStorVolume, error)
Patch patches the cstorvolume resource
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 WithClientSet ¶
func WithClientSet(c *clientset.Clientset) KubeclientBuildOption
WithClientSet 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 CstorVolumeList
func NewListBuilder ¶
func NewListBuilder() *ListBuilder
NewListBuilder returns a new instance of listBuilder
func (*ListBuilder) List ¶
func (b *ListBuilder) List() *CStorVolumeList
List returns the list of cstorvolume (cv) instances that was built by this builder
func (*ListBuilder) WithAPIList ¶
func (b *ListBuilder) WithAPIList(list *apis.CStorVolumeList) *ListBuilder
WithAPIList builds the list of cstorvolume instances based on the provided cstorvolume api instances
func (*ListBuilder) WithFilter ¶
func (b *ListBuilder) WithFilter(pred ...Predicate) *ListBuilder
WithFilter adds filters on which the cstorvolume has to be filtered
type Predicate ¶
type Predicate func(*CStorVolume) bool
Predicate defines an abstraction to determine conditional checks against the provided cstorvolume instance
type PredicateList ¶
type PredicateList []Predicate
PredicateList holds a list of cstor volume based predicates