Documentation ¶
Index ¶
- type Builder
- func (b *Builder) Build() (*apis.DeviceVolume, error)
- func (b *Builder) WithCapacity(capacity string) *Builder
- func (b *Builder) WithDeviceName(deviceName string) *Builder
- func (b *Builder) WithFinalizer(finalizer []string) *Builder
- func (b *Builder) WithLabels(labels map[string]string) *Builder
- func (b *Builder) WithName(name string) *Builder
- func (b *Builder) WithNamespace(namespace string) *Builder
- func (b *Builder) WithNodeName(name string) *Builder
- func (b *Builder) WithOwnerNode(host string) *Builder
- func (b *Builder) WithVolumeStatus(status string) *Builder
- type DeviceVolume
- type Kubeclient
- func (k *Kubeclient) Create(vol *apis.DeviceVolume) (*apis.DeviceVolume, error)
- func (k *Kubeclient) Delete(name string) error
- func (k *Kubeclient) Get(name string, opts metav1.GetOptions) (*apis.DeviceVolume, error)
- func (k *Kubeclient) GetRaw(name string, opts metav1.GetOptions) ([]byte, error)
- func (k *Kubeclient) List(opts metav1.ListOptions) (*apis.DeviceVolumeList, error)
- func (k *Kubeclient) Update(vol *apis.DeviceVolume) (*apis.DeviceVolume, error)
- func (k *Kubeclient) WithNamespace(namespace string) *Kubeclient
- type KubeclientBuildOption
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 (*Builder) Build ¶
func (b *Builder) Build() (*apis.DeviceVolume, error)
Build returns DeviceVolume API object
func (*Builder) WithCapacity ¶
WithCapacity sets the Capacity of device volume by converting string capacity into Quantity
func (*Builder) WithDeviceName ¶
WithDeviceName sets device name for creating volume
func (*Builder) WithFinalizer ¶
WithFinalizer sets Finalizer name creating the volume
func (*Builder) WithLabels ¶
WithLabels merges existing labels if any with the ones that are provided here
func (*Builder) WithNamespace ¶
WithNamespace sets the namespace of DeviceVolume
func (*Builder) WithNodeName ¶
WithNodeName sets NodeID for creating the volume
func (*Builder) WithOwnerNode ¶
WithOwnerNode sets owner node for the DeviceVolume where the volume should be provisioned
func (*Builder) WithVolumeStatus ¶
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 ¶
func (k *Kubeclient) List(opts metav1.ListOptions) (*apis.DeviceVolumeList, error)
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