blockdevice

package
v0.8.0-RC1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// FilterActive is the filter for getting active BDs
	FilterActive = "filterActive"
	// FilterUnclaimed is the filter for getting unclaimed BDs
	FilterUnclaimed = "filterUnclaimed"
	// FilterDeviceType is the filter for matching DeviceType like SSD, HDD, sparse
	FilterDeviceType = "filterDeviceType"
	// FilterVolumeMode is the  filter for filtering based on Volume Mode required
	FilterVolumeMode = "filterVolumeMode"
	// FilterBlockDeviceName is the filter for getting a BD based on a name
	FilterBlockDeviceName = "filterBlockDeviceName"
	// FilterResourceStorage is the filter for matching resource storage
	FilterResourceStorage = "filterResourceStorage"
	// FilterOutSparseBlockDevices is used to filter out sparse BDs
	FilterOutSparseBlockDevices = "filterSparseBlockDevice"
	// FilterNodeName is used to filter based on nodename
	FilterNodeName = "filterNodeName"
	// FilterBlockDeviceTag is used to filter out blockdevices having
	// openebs.io/blockdevice-tag label
	FilterBlockDeviceTag = "filterBlockDeviceTag"
	// FilterOutLegacyAnnotation is used to filter out devices with legacy annotation
	FilterOutLegacyAnnotation = "filterOutLegacyAnnotation"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Client          client.Client
	ClaimSpec       *v1alpha1.DeviceClaimSpec
	ManualSelection bool
}

Config stores the configuration for selecting a block device from a block device claim. It contains the claim spec, selection type and client to interface with etcd

func NewConfig

func NewConfig(claimSpec *v1alpha1.DeviceClaimSpec, client client.Client) *Config

NewConfig creates a new Config struct for the block device claim

func (*Config) ApplyFilters

func (c *Config) ApplyFilters(bdList *apis.BlockDeviceList, filterKeys ...string) *apis.BlockDeviceList

ApplyFilters apply the filter specified in the filterkeys on the given BD List,

func (*Config) Filter

func (c *Config) Filter(bdList *apis.BlockDeviceList) (*apis.BlockDevice, error)

Filter selects a single block device from a list of block devices

Jump to

Keyboard shortcuts

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