k8s

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2022 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNodeNotFound = errors.New("node not found")

ErrNodeNotFound represents the error that node is not found.

View Source
var ErrVolumeNotFound = errors.New("VolumeID is not found")

ErrVolumeNotFound represents the specified volume is not found.

Functions

This section is empty.

Types

type LogicVolumeService

type LogicVolumeService struct {
	client.Client
	// contains filtered or unexported fields
}

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, name 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) GetLogicVolume

func (s *LogicVolumeService) GetLogicVolume(ctx context.Context, volumeID string) (*carinav1.LogicVolume, error)

GetLogicVolume GetVolume returns LogicVolume by volume ID.

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

type NodeService struct {
	client.Client
}

NodeService represents node service.

func NewNodeService

func NewNodeService(mgr manager.Manager) *NodeService

NewNodeService returns NodeService.

func (NodeService) GetCapacityByNodeName

func (s NodeService) GetCapacityByNodeName(ctx context.Context, name, deviceGroup string) (int64, error)

GetCapacityByNodeName returns VG capacity of specified node by name.

func (NodeService) GetTotalCapacity

func (s NodeService) GetTotalCapacity(ctx context.Context, deviceGroup string, topology *csi.Topology) (int64, error)

GetTotalCapacity returns total VG capacity of all nodes.

func (NodeService) HaveSelectedNode

func (s NodeService) HaveSelectedNode(ctx context.Context, namespace, name string) (string, error)

func (NodeService) SelectDeviceGroup

func (s NodeService) SelectDeviceGroup(ctx context.Context, request int64, nodeName string) (string, error)

func (NodeService) SelectMultiVolumeNode

func (s NodeService) SelectMultiVolumeNode(ctx context.Context, backendDeviceGroup, cacheDeviceGroup string, backendRequestGb, cacheRequestGb int64, requirement *csi.TopologyRequirement) (string, map[string]string, error)

func (NodeService) SelectVolumeNode

func (s NodeService) SelectVolumeNode(ctx context.Context, requestGb int64, deviceGroup string, requirement *csi.TopologyRequirement) (string, string, map[string]string, error)

Jump to

Keyboard shortcuts

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