restorebuilder

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 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 ZFSRestore

func BuildFrom

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

Build returns ZFSRestore 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 ZFSRestore

func (*Builder) WithNamespace

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

WithNamespace sets the namespace of ZFSRestore

func (*Builder) WithNode

func (b *Builder) WithNode(node string) *Builder

WithNode sets the node id for ZFSRestore

func (*Builder) WithRemote

func (b *Builder) WithRemote(server string) *Builder

WithRemote sets the node id for ZFSRestore

func (*Builder) WithStatus

func (b *Builder) WithStatus(status apis.ZFSRestoreStatus) *Builder

WithStatus sets the status for ZFSRestore

func (*Builder) WithVolSpec added in v1.5.0

func (b *Builder) WithVolSpec(vspec apis.VolumeInfo) *Builder

WithVolSpec copies volume spec to ZFSRestore Object

func (*Builder) WithVolume

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

WithVolume sets the name of ZFSRestore

type Kubeclient

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

Kubeclient enables kubernetes API operations on zfsrstr rstrume instance

func NewKubeclient

func NewKubeclient(opts ...KubeclientBuildOption) *Kubeclient

NewKubeclient returns a new instance of kubeclient meant for zfsrstr rstrume operations

func (*Kubeclient) Create

func (k *Kubeclient) Create(rstr *apis.ZFSRestore) (*apis.ZFSRestore, error)

Create creates a zfsrstr rstrume instance in kubernetes cluster

func (*Kubeclient) Delete

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

Delete deletes the zfsrstr rstrume from kubernetes

func (*Kubeclient) Get

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

Get returns zfsrstr rstrume object for given name

func (*Kubeclient) GetRaw

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

GetRaw returns zfsrstr rstrume instance in bytes

func (*Kubeclient) List

List returns a list of zfsrstr rstrume instances present in kubernetes cluster

func (*Kubeclient) Update

func (k *Kubeclient) Update(rstr *apis.ZFSRestore) (*apis.ZFSRestore, error)

Update updates this zfsrstr rstrume 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 ZFSRestoreList

func ListBuilderFrom

func ListBuilderFrom(bkps apis.ZFSRestoreList) *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.ZFSRestoreList

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(*ZFSRestore) 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 ZFSRestore instance

func HasLabels

func HasLabels(keyValuePair map[string]string) Predicate

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

func IsNil

func IsNil() Predicate

IsNil is predicate to filter out nil zfsrstr rstrume instances

type ZFSRestore

type ZFSRestore struct {
	// ZFSSnap object
	Object *apis.ZFSRestore
}

ZFSRestore is a wrapper over ZFSRestore API instance

func From

func From(rstr *apis.ZFSRestore) *ZFSRestore

From returns a new instance of zfsrstr rstrume

func (*ZFSRestore) GetAPIObject

func (rstr *ZFSRestore) GetAPIObject() *apis.ZFSRestore

GetAPIObject returns zfsrstr rstrume's API instance

func (*ZFSRestore) HasLabel

func (rstr *ZFSRestore) HasLabel(key, value string) bool

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

func (*ZFSRestore) IsNil

func (rstr *ZFSRestore) IsNil() bool

IsNil returns true if the zfsrstr rstrume instance is nil

type ZFSRestoreList

type ZFSRestoreList struct {
	// List contains list of restore
	List apis.ZFSRestoreList
}

ZFSRestoreList holds the list of zfs restore instances

func (*ZFSRestoreList) Len

func (rstrList *ZFSRestoreList) Len() int

Len returns the number of items present in the ZFSRestoreList

Jump to

Keyboard shortcuts

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