v1alpha1

package
v1.12.1-RC1 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2020 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// StorageNodePredicateKey is the key for StorageNodePredicate function.
	FilterInactive    = "filterInactive"
	FilterNonInactive = "filterNonInactive"
	//FilterNonPartitions    = "filterNonPartitions"
	FilterNonFSType         = "filterNonFSType"
	FilterSparseDevices     = "filterSparseDevices"
	FilterNonSparseDevices  = "filterNonSparseDevices"
	InActiveStatus          = "Inactive"
	FilterNonRelesedDevices = "filterNonRelesedDevices"
)

TODO: Update the file with latest pattern

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockDevice

type BlockDevice struct {
	*ndm.BlockDevice
	// contains filtered or unexported fields
}

BlockDevice is a wrapper over BlockDevice api object. It provides build, validations and other common logic to be used by various feature specific callers

func New

func New(opts ...BuildOptionFunc) *BlockDevice

New is a constructor returns a new instance of block device

func (*BlockDevice) Build

func (bd *BlockDevice) Build() (*ndm.BlockDevice, []error)

Build returns the final instance of BlockDevice

func (*BlockDevice) GetDeviceID

func (bd *BlockDevice) GetDeviceID() string

GetDeviceID returns the device link of the block device. If device link is not found it returns device path. For a cstor pool creation -- this link or path is used. For convenience, we call it as device ID. Hence, device ID can either be a device link or device path depending on what was available in block device cr.

func (bd *BlockDevice) GetLink() string

GetLink returns the link of the block device if present else return empty string

func (*BlockDevice) GetPath

func (bd *BlockDevice) GetPath() string

GetPath returns path of the block device

func (*BlockDevice) IsClaimed

func (bd *BlockDevice) IsClaimed() bool

IsClaimed returns true if block device is claimed

func (*BlockDevice) WithName

func (bd *BlockDevice) WithName(name string) *BlockDevice

WithName method fills the name field of BlockDevice object.

func (*BlockDevice) WithState

func (bd *BlockDevice) WithState(state string) *BlockDevice

WithState method fills the name field of BlockDevice object.

type BlockDeviceInterface

type BlockDeviceInterface interface {
	Get(name string, opts metav1.GetOptions) (*BlockDevice, error)
	List(opts metav1.ListOptions) (*BlockDeviceList, error)
	Create(*ndm.BlockDevice) (*BlockDevice, error)
}

BlockDeviceInterface abstracts operations on BlockDevice entity. Different orchestrators may need to implement this interface.

type BlockDeviceList

type BlockDeviceList struct {
	*ndm.BlockDeviceList
	// contains filtered or unexported fields
}

BlockDeviceList is a wrapper over BlockDeviceList api object. It provides build, validations and other common logic to be used by various feature specific callers

func (*BlockDeviceList) Filter

func (bdl *BlockDeviceList) Filter(predicateKeys ...string) *BlockDeviceList

Filter adds filters on which the blockdevice has to be filtered

func (*BlockDeviceList) GetBlockDevice

func (bdl *BlockDeviceList) GetBlockDevice(bdcName string) *ndm.BlockDevice

GetBlockDevice returns the block device object present in the block device list

func (*BlockDeviceList) GetUsableBlockDevices

func (bdl *BlockDeviceList) GetUsableBlockDevices(spcName, namespace string) (*BlockDeviceList, error)

GetUsableBlockDevices returns custom blockdevice list(wrapper over api list) which contains list of blockdevice objects usable for provisioning

func (*BlockDeviceList) Hasitems

func (bdl *BlockDeviceList) Hasitems() (string, bool)

Hasitems checks whether the BlockDeviceList contains BlockDevices

type BuildOptionFunc

type BuildOptionFunc func(*BlockDevice)

BuildOptionFunc is the typed function to build BlockDevice object.

func WithName

func WithName(name string) BuildOptionFunc

WithName function is used by WithName method as a util. Ideas is to give flexibility for building object by using dot operator as well as passing build predicated to the New constructor.

func WithState

func WithState(state string) BuildOptionFunc

WithState function is used by WithState method as a util. Ideas is to give flexibility for building object by using dot operator as well as passing build predicated to the New constructor.

type KubernetesClient

type KubernetesClient struct {
	// Kubeclientset is a standard kubernetes clientset
	Kubeclientset kubernetes.Interface

	// Clientset is a ndm custom resource package generated for ndm custom API group
	Clientset ndmclientset.Interface

	//Namespace is namespace where blockdevice is available
	Namespace string
}

KubernetesClient is the kubernetes client which will implement block device actions/behaviours

func (*KubernetesClient) Create

func (k *KubernetesClient) Create(bdObj *ndm.BlockDevice) (*BlockDevice, error)

Create is kubernetes client implementation to create block device

func (*KubernetesClient) Get

func (k *KubernetesClient) Get(name string, opts metav1.GetOptions) (*BlockDevice, error)

Get is Kubernetes client implementation to get block device

func (*KubernetesClient) List

List is kubernetes client implementation to list block device

type SpcObjectClient

type SpcObjectClient struct {
	*KubernetesClient
	Spc *apis.StoragePoolClaim
}

SpcObjectClient is the kubernetes client perform block devie operations in case of manual provisioning

func (*SpcObjectClient) Create

func (s *SpcObjectClient) Create(bs *ndm.BlockDevice) (*BlockDevice, error)

Create is kubernetes client implementation to create blockdevice

func (*SpcObjectClient) Get

func (s *SpcObjectClient) Get(name string, opts metav1.GetOptions) (*BlockDevice, error)

Get is spc client implementation to get blockdevice

func (*SpcObjectClient) List

List is spc client implementation to list blockdevices

Jump to

Keyboard shortcuts

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