volbuilder

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 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 LVMVolume

func BuildFrom

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

Build returns LVMVolume API object

func (*Builder) WithCapacity

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

WithCapacity sets the Capacity of lvm volume by converting string capacity into Quantity

func (*Builder) WithFinalizer

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

WithFinalizer sets Finalizer name creating the volume

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 LVMVolume

func (*Builder) WithNamespace

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

WithNamespace sets the namespace of LVMVolume

func (*Builder) WithNodeName

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

WithNodeName sets NodeID for creating the volume

func (*Builder) WithOwnerNode

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

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

func (*Builder) WithShared

func (b *Builder) WithShared(shared string) *Builder

WithShared sets where filesystem is shared or not

func (*Builder) WithThinProvision added in v0.4.0

func (b *Builder) WithThinProvision(thinProvision string) *Builder

WithThinProvision sets where thinProvision is enable or not

func (*Builder) WithVgPattern added in v0.5.0

func (b *Builder) WithVgPattern(pattern string) *Builder

WithVgPattern sets volume group regex pattern.

func (*Builder) WithVolGroup

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

WithVolGroup sets volume group name for creating volume

func (*Builder) WithVolumeStatus

func (b *Builder) WithVolumeStatus(status string) *Builder

WithVolumeStatus sets LVMVolume status

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.LVMVolume) (*apis.LVMVolume, 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.LVMVolume, 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.LVMVolume) (*apis.LVMVolume, 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 LVMVolume

type LVMVolume struct {
	// LVMVolume object
	Object *apis.LVMVolume
}

LVMVolume is a wrapper over LVMVolume API instance

func From

func From(vol *apis.LVMVolume) *LVMVolume

From returns a new instance of lvm volume

Jump to

Keyboard shortcuts

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