Documentation ¶
Index ¶
- Variables
- type LogicVolumeService
- func (s *LogicVolumeService) CreateVolume(ctx context.Context, namespace, pvc, node, deviceGroup, pvName string, ...) (string, uint32, uint32, error)
- func (s *LogicVolumeService) DeleteVolume(ctx context.Context, volumeID string) error
- func (s *LogicVolumeService) ExpandVolume(ctx context.Context, volumeID string, requestGb int64) error
- func (s *LogicVolumeService) GetLogicVolumeByVolumeId(ctx context.Context, volumeID string) (*carinav1.LogicVolume, error)
- func (s *LogicVolumeService) GetLogicVolumesByNodeName(ctx context.Context, nodeName string, tryReader bool) ([]*carinav1.LogicVolume, error)
- func (s *LogicVolumeService) UpdateLogicVolumeCurrentSize(ctx context.Context, volumeID string, size *resource.Quantity) error
- func (s *LogicVolumeService) UpdateLogicVolumeSpecSize(ctx context.Context, volumeID string, size *resource.Quantity) error
- type NodeService
- func (n NodeService) GetCapacityByNodeName(ctx context.Context, nodeName, lvDeviceGroup string) (int64, error)
- func (n NodeService) GetTotalCapacity(ctx context.Context, scDeviceGroup string, topology *csi.Topology, ...) (int64, error)
- func (n NodeService) HaveSelectedNode(ctx context.Context, namespace, name string) (string, error)
- func (n NodeService) SelectDeviceGroup(ctx context.Context, requestGb int64, exclusivityDisk bool, ...) (string, error)
- func (n NodeService) SelectMultiVolumeNode(ctx context.Context, backendDeviceGroup, cacheDeviceGroup string, ...) (string, error)
- func (n NodeService) SelectNode(ctx context.Context, requestGb int64, volumeType, scDeviceGroup string, ...) (string, string, error)
Constants ¶
This section is empty.
Variables ¶
var ErrNodeNotFound = errors.New("node not found")
ErrNodeNotFound represents the error that node is not found.
var ErrVolumeNotFound = errors.New("volume not found")
ErrVolumeNotFound represents the specified volume is not found.
Functions ¶
This section is empty.
Types ¶
type LogicVolumeService ¶
LogicVolumeService represents service for LogicVolume.
func NewLogicVolumeService ¶
func NewLogicVolumeService(mgr manager.Manager) (*LogicVolumeService, error)
NewLogicVolumeService returns LogicVolumeService.
func (*LogicVolumeService) CreateVolume ¶
func (s *LogicVolumeService) CreateVolume(ctx context.Context, namespace, pvc, node, deviceGroup, pvName string, requestGb int64, owner metav1.OwnerReference, annotation map[string]string) (string, uint32, uint32, error)
CreateVolume creates volume
func (*LogicVolumeService) DeleteVolume ¶
func (s *LogicVolumeService) DeleteVolume(ctx context.Context, volumeID string) error
DeleteVolume deletes volume
func (*LogicVolumeService) ExpandVolume ¶
func (s *LogicVolumeService) ExpandVolume(ctx context.Context, volumeID string, requestGb int64) error
ExpandVolume expands volume
func (*LogicVolumeService) GetLogicVolumeByVolumeId ¶ added in v0.11.0
func (s *LogicVolumeService) GetLogicVolumeByVolumeId(ctx context.Context, volumeID string) (*carinav1.LogicVolume, error)
GetLogicVolumeByVolumeId returns logicVolume by volume ID.
func (*LogicVolumeService) GetLogicVolumesByNodeName ¶ added in v0.11.0
func (s *LogicVolumeService) GetLogicVolumesByNodeName(ctx context.Context, nodeName string, tryReader bool) ([]*carinav1.LogicVolume, error)
GetLogicVolumesByNodeName returns logicVolumes by node name.
func (*LogicVolumeService) UpdateLogicVolumeCurrentSize ¶
func (s *LogicVolumeService) UpdateLogicVolumeCurrentSize(ctx context.Context, volumeID string, size *resource.Quantity) error
UpdateLogicVolumeCurrentSize UpdateCurrentSize updates .Status.CurrentSize of LogicVolume.
func (*LogicVolumeService) UpdateLogicVolumeSpecSize ¶
func (s *LogicVolumeService) UpdateLogicVolumeSpecSize(ctx context.Context, volumeID string, size *resource.Quantity) error
UpdateLogicVolumeSpecSize UpdateSpecSize updates .Spec.Size of LogicVolume.
type NodeService ¶
NodeService represents node service.
func NewNodeService ¶
func NewNodeService(mgr manager.Manager, lvService *LogicVolumeService) *NodeService
NewNodeService returns NodeService.
func (NodeService) GetCapacityByNodeName ¶
func (n NodeService) GetCapacityByNodeName(ctx context.Context, nodeName, lvDeviceGroup string) (int64, error)
GetCapacityByNodeName returns capacity of specified node by name.
func (NodeService) GetTotalCapacity ¶
func (n NodeService) GetTotalCapacity(ctx context.Context, scDeviceGroup string, topology *csi.Topology, exclusivityDisk bool) (int64, error)
GetTotalCapacity returns total capacity of all nodes.
func (NodeService) HaveSelectedNode ¶
func (NodeService) SelectDeviceGroup ¶
func (NodeService) SelectMultiVolumeNode ¶
func (n NodeService) SelectMultiVolumeNode(ctx context.Context, backendDeviceGroup, cacheDeviceGroup string, backendRequestGb, cacheRequestGb int64, requirement *csi.TopologyRequirement) (string, error)