volbuilder

package
v1.9.3 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2021 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 ZFSVolume

func BuildFrom

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

Build returns ZFSVolume API object

func (*Builder) WithCapacity

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

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

func (*Builder) WithCompression

func (b *Builder) WithCompression(compression string) *Builder

WithCompression sets compression of ZFSVolume

func (*Builder) WithDedup

func (b *Builder) WithDedup(dedup string) *Builder

WithDedup sets dedup property of ZFSVolume

func (*Builder) WithEncryption

func (b *Builder) WithEncryption(encr string) *Builder

WithEncryption sets the encryption on ZFSVolume

func (*Builder) WithFinalizer

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

WithFinalizer sets Finalizer name creating the volume

func (*Builder) WithFsType

func (b *Builder) WithFsType(fstype string) *Builder

WithFsType sets filesystem for the ZFSVolume

func (*Builder) WithKeyFormat

func (b *Builder) WithKeyFormat(kf string) *Builder

WithKeyFormat sets the encryption key format on ZFSVolume

func (*Builder) WithKeyLocation

func (b *Builder) WithKeyLocation(kl string) *Builder

WithKeyLocation sets the encryption key location on ZFSVolume

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 ZFSVolume

func (*Builder) WithNamespace

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

WithNamespace sets the namespace of ZFSVolume

func (*Builder) WithNodeName added in v0.8.0

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

WithNodeName sets NodeID for creating the volume

func (*Builder) WithOwnerNodeID added in v1.7.0

func (b *Builder) WithOwnerNodeID(nodeid string) *Builder

WithOwnerNodeID sets owner nodeid for the ZFSVolume where the volume should be provisioned

func (*Builder) WithPoolName

func (b *Builder) WithPoolName(pool string) *Builder

WithPoolName sets Pool name for creating volume

func (*Builder) WithRecordSize

func (b *Builder) WithRecordSize(rs string) *Builder

WithRecordSize sets the recordsize of ZFSVolume

func (*Builder) WithShared added in v0.9.0

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

WithShared sets where filesystem is shared or not

func (*Builder) WithSnapshot

func (b *Builder) WithSnapshot(snap string) *Builder

WithSnapshot sets Snapshot name for creating clone volume

func (*Builder) WithThinProv

func (b *Builder) WithThinProv(thinprov string) *Builder

WithThinProv sets if ZFSVolume needs to be thin provisioned

func (*Builder) WithVolBlockSize

func (b *Builder) WithVolBlockSize(bs string) *Builder

WithVolBlockSize sets the volblocksize of ZFSVolume

func (*Builder) WithVolumeStatus added in v0.8.0

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

WithVolumeStatus sets ZFSVolume status

func (*Builder) WithVolumeType

func (b *Builder) WithVolumeType(vtype string) *Builder

WithVolumeType sets if ZFSVolume needs to be thin provisioned

type Kubeclient

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

Kubeclient enables kubernetes API operations on zfs volume instance

func NewKubeclient

func NewKubeclient(opts ...KubeclientBuildOption) *Kubeclient

NewKubeclient returns a new instance of kubeclient meant for zfs volume operations

func (*Kubeclient) Create

func (k *Kubeclient) Create(vol *apis.ZFSVolume) (*apis.ZFSVolume, error)

Create creates a zfs volume instance in kubernetes cluster

func (*Kubeclient) Delete

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

Delete deletes the zfs volume from kubernetes

func (*Kubeclient) Get

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

Get returns zfs volume object for given name

func (*Kubeclient) GetRaw

func (k *Kubeclient) GetRaw(
	name string,
	opts metav1.GetOptions,
) ([]byte, error)

GetRaw returns zfs volume instance in bytes

func (*Kubeclient) List

List returns a list of zfs volume instances present in kubernetes cluster

func (*Kubeclient) Update

func (k *Kubeclient) Update(vol *apis.ZFSVolume) (*apis.ZFSVolume, error)

Update updates this zfs 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 ListBuilder

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

ListBuilder enables building an instance of ZFSVolumeList

func ListBuilderFrom

func ListBuilderFrom(vols apis.ZFSVolumeList) *ListBuilder

ListBuilderFrom returns a new instance of ListBuilder from API list instance

func NewListBuilder

func NewListBuilder() *ListBuilder

NewListBuilder returns a new instance of ListBuilder

func (*ListBuilder) List

func (b *ListBuilder) List() *apis.ZFSVolumeList

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

func (*ListBuilder) WithFilter

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

WithFilter add filters on which the pod has to be filtered

type Predicate

type Predicate func(*ZFSVolume) bool

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

func HasLabel

func HasLabel(key, value string) Predicate

HasLabel returns true if provided label is present in the provided ZFSVolume instance

func HasLabels

func HasLabels(keyValuePair map[string]string) Predicate

HasLabels returns true if provided labels are present in the provided ZFSVolume instance

func IsNil

func IsNil() Predicate

IsNil is predicate to filter out nil zfs volume instances

type ZFSVolume

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

ZFSVolume is a wrapper over ZFSVolume API instance

func From

func From(vol *apis.ZFSVolume) *ZFSVolume

From returns a new instance of zfs volume

func (*ZFSVolume) GetAPIObject

func (vol *ZFSVolume) GetAPIObject() *apis.ZFSVolume

GetAPIObject returns zfs volume's API instance

func (*ZFSVolume) HasLabel

func (vol *ZFSVolume) HasLabel(key, value string) bool

HasLabel returns true if provided label is present in the provided ZFSVolume instance

func (*ZFSVolume) IsNil

func (vol *ZFSVolume) IsNil() bool

IsNil returns true if the zfs volume instance is nil

type ZFSVolumeList

type ZFSVolumeList struct {
	// List conatils list of volumes
	List apis.ZFSVolumeList
}

ZFSVolumeList holds the list of zfs volume instances

func (*ZFSVolumeList) Len

func (volList *ZFSVolumeList) Len() int

Len returns the number of items present in the ZFSVolumeList

Jump to

Keyboard shortcuts

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