driver

package
v0.29.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	DefaultVolumeSizeGiB = 100
	MinimalVolumeSizeGiB = 10
	MaximumVolumeSizeGiB = 10000
)
View Source
const (
	// DriverName is the official name for the Exoscale CSI plugin
	DriverName      = "csi.exoscale.com"
	ZoneTopologyKey = "topology." + DriverName + "/zone"
)
View Source
const (
	GiB = 1024 * 1024 * 1024
)

Variables

This section is empty.

Functions

func GetVersionJSON

func GetVersionJSON() (string, error)

GetVersionJSON returns the current running version in JSON

Types

type DiskUtils

type DiskUtils interface {
	// GetDevicePath returns the path for the specified volumeID
	GetDevicePath(volumeID string) (string, error)
	FormatAndMount(targetPath string, devicePath string, fsType string, mountOptions []string) error
	IsSharedMounted(targetPath string, devicePath string) (bool, error)
	GetMountInfo(targetPath string) (*mountInfo, error)
	IsBlockDevice(path string) (bool, error)
	MountToTarget(sourcePath, targetPath, fsType string, mountOptions []string) error
	Unmount(target string) error
	GetStatfs(path string) (*unix.Statfs_t, error)
	Resize(targetPath string, devicePath string) error
}

type Driver

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

Driver implements the interfaces csi.IdentityServer, csi.ControllerServer and csi.NodeServer

func NewDriver

func NewDriver(config *DriverConfig) (*Driver, error)

NewDriver returns a CSI plugin

func (*Driver) ControllerExpandVolume

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

ControllerExpandVolume resizes Block Storage volume.

func (*Driver) ControllerGetCapabilities

func (d *Driver) ControllerGetCapabilities(ctx context.Context, req *csi.ControllerGetCapabilitiesRequest) (*csi.ControllerGetCapabilitiesResponse, error)

ControllerGetCapabilities returns the supported capabilities of controller service provided by the Plugin.

func (*Driver) ControllerGetVolume

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

ControllerGetVolume gets a volume and return it.

func (*Driver) ControllerPublishVolume

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

ControllerPublishVolume should call ProvisionAndAttachVolume. This operation MUST be idempotent. Exoscale Attach

func (*Driver) ControllerUnpublishVolume

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

ControllerUnpublishVolume call blockstoraqge DetachAndDeprovisionVolume This operation MUST be idempotent. Exoscale Detach

func (*Driver) CreateSnapshot

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

CreateSnapshot call blockstorage SnapshotVolume.

func (*Driver) CreateVolume

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

CreateVolume creates a new volume from CreateVolumeRequest with blockstorage ProvisionVolume. This function is idempotent.

func (*Driver) DeleteSnapshot

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

DeleteSnapshot destroys a block storage volume snapshot.

func (*Driver) DeleteVolume

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

DeleteVolume detach and deprovision a volume. This operation MUST be idempotent.

func (*Driver) GetCapacity

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

GetCapacity returns the capacity of the "storage pool" from which the controller provisions volumes.

func (*Driver) GetPluginCapabilities

GetPluginCapabilities allows to query the supported capabilities of the Plugin as a whole

func (*Driver) GetPluginInfo

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

GetPluginInfo returns metadata about the plugin

func (*Driver) ListSnapshots

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

ListSnapshots lists block storage volume snapshot.

func (*Driver) ListVolumes

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

ListVolumes returns the list of requested volumes.

func (*Driver) NodeExpandVolume

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

NodeExpandVolume expands the given volume, mkfs, resize...etc not supported yet at Exoscale Public API yet.

func (*Driver) NodeGetCapabilities

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

NodeGetCapabilities allows the CO to check the supported capabilities of node service provided by the Plugin.

func (*Driver) NodeGetInfo

func (d *Driver) NodeGetInfo(ctx context.Context, req *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error)

NodeGetInfo returns inqformation about node's volumes

func (*Driver) NodeGetVolumeStats

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

NodeGetVolumeStats returns the volume capacity statistics available for the volume

func (*Driver) NodePublishVolume

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

Mounting volume in right path...etc.

func (*Driver) NodeStageVolume

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

NodeStageVolume prepare the physical volume to be ready. format, mkfs...etc.

func (*Driver) NodeUnpublishVolume

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

Unmounting volume.

func (*Driver) NodeUnstageVolume

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

Specific fs cleanup or close like luks close...etc.

func (*Driver) Probe

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

Probe allows to verify that the plugin is in a healthy and ready state

func (*Driver) Run

func (d *Driver) Run() error

Run starts the CSI plugin on the given endpoint

func (*Driver) ValidateVolumeCapabilities

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

ValidateVolumeCapabilities check if a pre-provisioned volume has all the capabilities that the CO wants. Get the volume info and check if it's match the CO needs. This operation MUST be idempotent.

type DriverConfig

type DriverConfig struct {
	Endpoint     string
	Prefix       string
	Mode         Mode
	Credentials  *credentials.Credentials
	RestConfig   *rest.Config
	ZoneEndpoint v3.Endpoint
}

DriverConfig is used to configure a new Driver

type Mode

type Mode string

Mode represents the mode in which the CSI driver started

const (
	// ControllerMode represents the controller mode
	ControllerMode Mode = "controller"
	// NodeMode represents the node mode
	NodeMode Mode = "node"
	// AllMode represents the the controller and the node mode at the same time
	AllMode Mode = "all"
)

type VersionInfo

type VersionInfo struct {
	DriverVersion string `json:"driverVersion"`
	GitCommit     string `json:"gitCommit"`
	BuildDate     string `json:"buildDate"`
	GoVersion     string `json:"goVersion"`
	Compiler      string `json:"compiler"`
	Platform      string `json:"platform"`
}

VersionInfo represents the current running version

func GetVersion

func GetVersion() VersionInfo

GetVersion returns the current running version

Jump to

Keyboard shortcuts

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