driver

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2022 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GiB                  = 1 << (10 * 3)
	MinVolumeSize        = 1 * GiB
	DefaultVolumeSize    = MinVolumeSize
	VolumeProductSlugKey = "product-slug"
)
View Source
const (
	DriverName                = "csi.advancedhosting.com"
	DriverVersion             = "1.0.0"
	TopologySegmentDatacenter = DriverName + "/datacenter"
	ControllerMode            = "controller"
	NodeMode                  = "node"
)
View Source
const (
	DefaultFSType     = "ext4"
	MaxVolumesPerNode = 8
	InstancePath      = "/var/lib/cloud/instance"
)

Variables

View Source
var (
	ErrTimeout = errors.New("timeout was exceeded while waiting expected state")
)

Functions

func NewControllerService

func NewControllerService(client *ah.APIClient, clusterID string) *controllerService

func NewNodeService

func NewNodeService(client *ah.APIClient) (*nodeService, error)

Types

type Driver

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

Driver implements the csi driver according the spec

func NewDriver

func NewDriver(options *DriverOptions) (*Driver, error)

func (Driver) ControllerExpandVolume

func (c Driver) ControllerExpandVolume(ctx context.Context, req *csi.ControllerExpandVolumeRequest) (*csi.ControllerExpandVolumeResponse, error)

func (Driver) ControllerGetCapabilities

func (c Driver) ControllerGetCapabilities(cxt context.Context, req *csi.ControllerGetCapabilitiesRequest) (*csi.ControllerGetCapabilitiesResponse, error)

func (Driver) ControllerGetVolume

func (c Driver) ControllerGetVolume(ctx context.Context, req *csi.ControllerGetVolumeRequest) (*csi.ControllerGetVolumeResponse, error)

func (Driver) ControllerPublishVolume

func (c Driver) ControllerPublishVolume(ctx context.Context, req *csi.ControllerPublishVolumeRequest) (*csi.ControllerPublishVolumeResponse, error)

func (Driver) ControllerUnpublishVolume

func (c Driver) ControllerUnpublishVolume(ctx context.Context, req *csi.ControllerUnpublishVolumeRequest) (*csi.ControllerUnpublishVolumeResponse, error)

func (Driver) CreateSnapshot

func (c Driver) CreateSnapshot(ctx context.Context, req *csi.CreateSnapshotRequest) (*csi.CreateSnapshotResponse, error)

func (Driver) CreateVolume

func (c Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest) (*csi.CreateVolumeResponse, error)

func (Driver) DeleteSnapshot

func (c Driver) DeleteSnapshot(ctx context.Context, req *csi.DeleteSnapshotRequest) (*csi.DeleteSnapshotResponse, error)

func (Driver) DeleteVolume

func (c Driver) DeleteVolume(ctx context.Context, req *csi.DeleteVolumeRequest) (*csi.DeleteVolumeResponse, error)

func (Driver) GetCapacity

func (c Driver) GetCapacity(ctx context.Context, req *csi.GetCapacityRequest) (*csi.GetCapacityResponse, error)

func (*Driver) GetPluginCapabilities

GetPluginCapabilities returns capabilities of the plugin

func (*Driver) GetPluginInfo

func (d *Driver) GetPluginInfo(ctx context.Context, req *csi.GetPluginInfoRequest) (*csi.GetPluginInfoResponse, error)

GetPluginInfo returns metadata

func (Driver) ListSnapshots

func (c Driver) ListSnapshots(ctx context.Context, req *csi.ListSnapshotsRequest) (*csi.ListSnapshotsResponse, error)

func (Driver) ListVolumes

func (c Driver) ListVolumes(ctx context.Context, req *csi.ListVolumesRequest) (*csi.ListVolumesResponse, error)

func (Driver) NodeExpandVolume

func (n Driver) NodeExpandVolume(ctx context.Context, req *csi.NodeExpandVolumeRequest) (*csi.NodeExpandVolumeResponse, error)

func (Driver) NodeGetCapabilities

func (n Driver) NodeGetCapabilities(ctx context.Context, req *csi.NodeGetCapabilitiesRequest) (*csi.NodeGetCapabilitiesResponse, error)

func (Driver) NodeGetInfo

func (n Driver) NodeGetInfo(context.Context, *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error)

func (Driver) NodeGetVolumeStats

func (n Driver) NodeGetVolumeStats(ctx context.Context, req *csi.NodeGetVolumeStatsRequest) (*csi.NodeGetVolumeStatsResponse, error)

func (Driver) NodePublishVolume

func (n Driver) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error)

func (Driver) NodeStageVolume

func (n Driver) NodeStageVolume(ctx context.Context, req *csi.NodeStageVolumeRequest) (*csi.NodeStageVolumeResponse, error)

func (Driver) NodeUnpublishVolume

func (n Driver) NodeUnpublishVolume(ctx context.Context, req *csi.NodeUnpublishVolumeRequest) (*csi.NodeUnpublishVolumeResponse, error)

func (Driver) NodeUnstageVolume

func (n Driver) NodeUnstageVolume(ctx context.Context, req *csi.NodeUnstageVolumeRequest) (*csi.NodeUnstageVolumeResponse, error)

func (*Driver) Probe

func (d *Driver) Probe(ctx context.Context, req *csi.ProbeRequest) (*csi.ProbeResponse, error)

Probe checks driver

func (*Driver) Run

func (d *Driver) Run() error

func (Driver) ValidateVolumeCapabilities

func (c Driver) ValidateVolumeCapabilities(ctx context.Context, req *csi.ValidateVolumeCapabilitiesRequest) (*csi.ValidateVolumeCapabilitiesResponse, error)

type DriverOptions

type DriverOptions struct {
	Endpoint  string
	Url       string
	Token     string
	ClusterID string
	Mode      string
}

type LinuxMounter

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

func NewLinuxMounter

func NewLinuxMounter() *LinuxMounter

func (*LinuxMounter) BlockSize

func (m *LinuxMounter) BlockSize(path string) (int64, error)

func (*LinuxMounter) BytesFSMetrics

func (m *LinuxMounter) BytesFSMetrics(path string) (available, total, used int64, err error)

func (*LinuxMounter) CreateDir

func (m *LinuxMounter) CreateDir(path string) error

func (*LinuxMounter) CreateFile

func (m *LinuxMounter) CreateFile(path string) error

func (*LinuxMounter) DeviceNameFromMount

func (m *LinuxMounter) DeviceNameFromMount(mountPath string) (string, error)

func (*LinuxMounter) DevicePath

func (m *LinuxMounter) DevicePath(volumeNumber string) (string, error)

func (*LinuxMounter) FormatAndMount

func (m *LinuxMounter) FormatAndMount(source, target, fsType string, options []string) error

func (*LinuxMounter) INodeFSMetrics

func (m *LinuxMounter) INodeFSMetrics(path string) (available, total, used int64, err error)

func (*LinuxMounter) IsBlockDevice

func (m *LinuxMounter) IsBlockDevice(path string) (bool, error)

func (*LinuxMounter) IsDeviceMountedToTarget

func (m *LinuxMounter) IsDeviceMountedToTarget(devicePath, targetPath string) (bool, error)

func (*LinuxMounter) IsPathExists

func (m *LinuxMounter) IsPathExists(path string) (bool, error)

func (*LinuxMounter) Mount

func (m *LinuxMounter) Mount(source, target, fsType string, options []string) error

func (*LinuxMounter) Resize

func (m *LinuxMounter) Resize(devicePath, deviceMountPath string) error

func (*LinuxMounter) Unmount

func (m *LinuxMounter) Unmount(target string) error

type Mounter

type Mounter interface {
	DevicePath(string) (string, error)
	IsPathExists(string) (bool, error)
	FormatAndMount(string, string, string, []string) error
	Mount(string, string, string, []string) error
	Unmount(string) error
	CreateDir(string) error
	CreateFile(string) error
	DeviceNameFromMount(string) (string, error)
	IsDeviceMountedToTarget(string, string) (bool, error)
	IsBlockDevice(string) (bool, error)
	BlockSize(string) (int64, error)
	BytesFSMetrics(string) (int64, int64, int64, error)
	INodeFSMetrics(string) (int64, int64, int64, error)
	Resize(string, string) error
}

Directories

Path Synopsis
Package mock_ah is a generated GoMock package.
Package mock_ah is a generated GoMock package.

Jump to

Keyboard shortcuts

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