Documentation ¶
Index ¶
- type Builder
- func (b *Builder) Build() (*apis.LVMSnapshot, error)
- func (b *Builder) WithFinalizer(finalizer []string) *Builder
- func (b *Builder) WithLabels(labels map[string]string) *Builder
- func (b *Builder) WithName(name string) *Builder
- func (b *Builder) WithNamespace(namespace string) *Builder
- func (b *Builder) WithOwnerNode(host string) *Builder
- func (b *Builder) WithSnapSize(capacity string) *Builder
- func (b *Builder) WithVolGroup(vg string) *Builder
- type Kubeclient
- func (k *Kubeclient) Create(vol *apis.LVMSnapshot) (*apis.LVMSnapshot, error)
- func (k *Kubeclient) Delete(name string) error
- func (k *Kubeclient) Get(name string, opts metav1.GetOptions) (*apis.LVMSnapshot, error)
- func (k *Kubeclient) GetRaw(name string, opts metav1.GetOptions) ([]byte, error)
- func (k *Kubeclient) List(opts metav1.ListOptions) (*apis.LVMSnapshotList, error)
- func (k *Kubeclient) Update(vol *apis.LVMSnapshot) (*apis.LVMSnapshot, error)
- func (k *Kubeclient) WithNamespace(namespace string) *Kubeclient
- type KubeclientBuildOption
- type LVMSnapshot
- type LVMSnapshotList
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 LVMSnapshot
func BuildFrom ¶
func BuildFrom(snap *apis.LVMSnapshot) *Builder
BuildFrom returns new instance of Builder from the provided api instance
func (*Builder) Build ¶
func (b *Builder) Build() (*apis.LVMSnapshot, error)
Build returns LVMSnapshot API object
func (*Builder) WithFinalizer ¶
WithFinalizer merge existing finalizers if any with the ones that are provided here
func (*Builder) WithLabels ¶
WithLabels merges existing labels if any with the ones that are provided here
func (*Builder) WithNamespace ¶
WithNamespace sets the namespace of LVMSnapshot
func (*Builder) WithOwnerNode ¶ added in v0.7.0
WithOwnerNode sets owner node for the LVMVolume where the snapshot should be provisioned
func (*Builder) WithSnapSize ¶ added in v0.7.0
WithSnapshotSize sets the SnapSize of lvm snapshot
func (*Builder) WithVolGroup ¶ added in v0.7.0
WithVolGroup sets volume group name for creating snapshot
type Kubeclient ¶
type Kubeclient struct {
// contains filtered or unexported fields
}
Kubeclient enables kubernetes API operations on lvm volume instance
func NewKubeclient ¶
func NewKubeclient(opts ...KubeclientBuildOption) *Kubeclient
NewKubeclient returns a new instance of kubeclient meant for lvm volume operations
func (*Kubeclient) Create ¶
func (k *Kubeclient) Create(vol *apis.LVMSnapshot) (*apis.LVMSnapshot, error)
Create creates a lvm volume instance in kubernetes cluster
func (*Kubeclient) Delete ¶
func (k *Kubeclient) Delete(name string) error
Delete deletes the lvm volume from kubernetes
func (*Kubeclient) Get ¶
func (k *Kubeclient) Get( name string, opts metav1.GetOptions, ) (*apis.LVMSnapshot, error)
Get returns lvm volume object for given name
func (*Kubeclient) GetRaw ¶
func (k *Kubeclient) GetRaw( name string, opts metav1.GetOptions, ) ([]byte, error)
GetRaw returns lvm volume instance in bytes
func (*Kubeclient) List ¶
func (k *Kubeclient) List(opts metav1.ListOptions) (*apis.LVMSnapshotList, error)
List returns a list of lvm volume instances present in kubernetes cluster
func (*Kubeclient) Update ¶
func (k *Kubeclient) Update(vol *apis.LVMSnapshot) (*apis.LVMSnapshot, error)
Update updates this lvm volume instance against kubernetes cluster
func (*Kubeclient) WithNamespace ¶
func (k *Kubeclient) WithNamespace(namespace string) *Kubeclient
WithNamespace sets the provided namespace against this Kubeclient instance
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 LVMSnapshot ¶
type LVMSnapshot struct {
Object *apis.LVMSnapshot
}
LVMSnapshot is a wrapper over LVMSnapshot API instance
func From ¶
func From(snap *apis.LVMSnapshot) *LVMSnapshot
From returns a new instance of lvmsnap volume
type LVMSnapshotList ¶
type LVMSnapshotList struct {
List apis.LVMSnapshotList
}
LVMSnapshotList holds the list of lvm snapshot instances
func (*LVMSnapshotList) Len ¶
func (snapList *LVMSnapshotList) Len() int
Len returns the number of items present in the LVMSnapshotList