snapbuilder

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: Apache-2.0 Imports: 8 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 LVMSnapshot

func BuildFrom

func BuildFrom(snap *apis.LVMSnapshot) *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() (*apis.LVMSnapshot, error)

Build returns LVMSnapshot API object

func (*Builder) WithFinalizer

func (b *Builder) WithFinalizer(finalizer []string) *Builder

WithFinalizer merge existing finalizers if any with the ones that are provided here

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

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

WithName sets the name of LVMSnapshot

func (*Builder) WithNamespace

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

WithNamespace sets the namespace of LVMSnapshot

func (*Builder) WithOwnerNode added in v0.7.0

func (b *Builder) WithOwnerNode(host string) *Builder

WithOwnerNode sets owner node for the LVMVolume where the snapshot should be provisioned

func (*Builder) WithSnapSize added in v0.7.0

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

WithSnapshotSize sets the SnapSize of lvm snapshot

func (*Builder) WithVolGroup added in v0.7.0

func (b *Builder) WithVolGroup(vg string) *Builder

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

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

Jump to

Keyboard shortcuts

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