k8s

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDeviceClassNotFound = errors.New("device class not found")
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 LogicalVolumeService

type LogicalVolumeService struct {
	// contains filtered or unexported fields
}

LogicalVolumeService represents service for LogicalVolume. This is not concurrent safe, must take lock on caller.

func NewLogicalVolumeService

func NewLogicalVolumeService(mgr manager.Manager) (*LogicalVolumeService, error)

NewLogicalVolumeService returns LogicalVolumeService.

func (*LogicalVolumeService) CreateSnapshot

func (s *LogicalVolumeService) CreateSnapshot(ctx context.Context, node, dc, sourceVol, sname, accessType string, snapSize resource.Quantity) (string, error)

CreateSnapshot creates a snapshot of existing volume.

func (*LogicalVolumeService) CreateVolume

func (s *LogicalVolumeService) CreateVolume(ctx context.Context, node, dc, oc, name, sourceName string, requestBytes int64) (string, error)

CreateVolume creates volume

func (*LogicalVolumeService) DeleteVolume

func (s *LogicalVolumeService) DeleteVolume(ctx context.Context, volumeID string) error

DeleteVolume deletes volume

func (*LogicalVolumeService) ExpandVolume

func (s *LogicalVolumeService) ExpandVolume(ctx context.Context, volumeID string, requestBytes int64) error

ExpandVolume expands volume

func (*LogicalVolumeService) GetVolume

func (s *LogicalVolumeService) GetVolume(ctx context.Context, volumeID string) (*topolvmv1.LogicalVolume, error)

GetVolume returns LogicalVolume by volume ID.

type NodeService

type NodeService struct {
	// contains filtered or unexported fields
}

NodeService represents node service.

func NewNodeService

func NewNodeService(r client.Reader) *NodeService

NewNodeService returns NodeService.

func (NodeService) GetCapacityByName

func (s NodeService) GetCapacityByName(ctx context.Context, name, deviceClass string) (int64, error)

GetCapacityByName returns VG capacity of specified node by name.

func (NodeService) GetCapacityByTopologyLabel

func (s NodeService) GetCapacityByTopologyLabel(ctx context.Context, topology, dc string) (int64, error)

GetCapacityByTopologyLabel returns VG capacity of specified node by TopoLVM's topology label.

func (NodeService) GetMaxCapacity

func (s NodeService) GetMaxCapacity(ctx context.Context, deviceClass string) (string, int64, error)

GetMaxCapacity returns max VG capacity among nodes.

func (NodeService) GetTotalCapacity

func (s NodeService) GetTotalCapacity(ctx context.Context, dc string) (int64, error)

GetTotalCapacity returns total VG capacity of all nodes.

Jump to

Keyboard shortcuts

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