volbuilder

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2021 License: Apache-2.0 Imports: 7 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 DeviceVolume

func BuildFrom

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

Build returns DeviceVolume API object

func (*Builder) WithCapacity

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

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

func (*Builder) WithDeviceName

func (b *Builder) WithDeviceName(deviceName string) *Builder

WithDeviceName sets device name for creating volume

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 DeviceVolume

func (*Builder) WithNamespace

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

WithNamespace sets the namespace of DeviceVolume

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 DeviceVolume where the volume should be provisioned

func (*Builder) WithVolumeStatus

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

WithVolumeStatus sets DeviceVolume status

type DeviceVolume

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

DeviceVolume is a wrapper over DeviceVolume API instance

func From

func From(vol *apis.DeviceVolume) *DeviceVolume

From returns a new instance of device volume

type Kubeclient

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

Kubeclient enables kubernetes API operations on device volume instance

func NewKubeclient

func NewKubeclient(opts ...KubeclientBuildOption) *Kubeclient

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

func (*Kubeclient) Create

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

Create creates a device volume instance in kubernetes cluster

func (*Kubeclient) Delete

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

Delete deletes the device volume from kubernetes

func (*Kubeclient) Get

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

Get returns device volume object for given name

func (*Kubeclient) GetRaw

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

GetRaw returns device volume instance in bytes

func (*Kubeclient) List

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

func (*Kubeclient) Update

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

Update updates this device 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

Jump to

Keyboard shortcuts

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