driver

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2025 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package driver provides the implementation of the CSI plugin.

It contains the gRPC server implementation of CSI specification.

Index

Constants

View Source
const (
	// DefaultCSIEndpoint is the default CSI endpoint for the driver.
	DefaultCSIEndpoint             = "unix://tmp/csi.sock"
	DefaultMaxVolAttachLimit int64 = 256
)

constants for default command line flag values.

View Source
const (
	// FSTypeExt2 represents the ext2 filesystem type.
	FSTypeExt2 = "ext2"
	// FSTypeExt3 represents the ext3 filesystem type.
	FSTypeExt3 = "ext3"
	// FSTypeExt4 represents the ext4 filesystem type.
	FSTypeExt4 = "ext4"
	// FSTypeXfs represents the xfs filesystem type.
	FSTypeXfs = "xfs"
)

Filesystem types.

View Source
const (
	ZoneKey = "topology." + DriverName + "/zone"
	HostKey = "topology." + DriverName + "/host"
)

Topology keys.

View Source
const (
	DiskOfferingKey = DriverName + "/disk-offering-id"
)

Volume parameters keys.

View Source
const DriverName = "csi.cloudstack.apache.org"

DriverName is the name of the CSI plugin.

Variables

View Source
var ValidFSTypes = map[string]struct{}{
	FSTypeExt2: {},
	FSTypeExt3: {},
	FSTypeExt4: {},
	FSTypeXfs:  {},
}

Functions

func GetVersionJSON added in v0.6.0

func GetVersionJSON() (string, error)

Types

type ControllerService added in v0.8.1

type ControllerService struct {
	csi.UnimplementedControllerServer
	// contains filtered or unexported fields
}

ControllerService represents the controller service of CSI driver.

func NewControllerService added in v0.8.1

func NewControllerService(connector cloud.Cloud) *ControllerService

NewControllerService creates a new controller service.

func (*ControllerService) ControllerExpandVolume added in v0.8.1

func (*ControllerService) ControllerGetCapabilities added in v0.8.1

func (*ControllerService) ControllerPublishVolume added in v0.8.1

func (*ControllerService) ControllerUnpublishVolume added in v0.8.1

func (*ControllerService) CreateVolume added in v0.8.1

func (*ControllerService) DeleteVolume added in v0.8.1

func (*ControllerService) ValidateVolumeCapabilities added in v0.8.1

type Driver added in v0.8.1

type Driver struct {
	csi.UnimplementedIdentityServer
	// contains filtered or unexported fields
}

func NewDriver added in v0.8.1

func NewDriver(ctx context.Context, csConnector cloud.Cloud, options *Options, mounter mount.Mounter) (*Driver, error)

NewDriver instantiates a new CloudStack CSI driver.

func (*Driver) GetPluginCapabilities added in v0.8.1

func (*Driver) GetPluginInfo added in v0.8.1

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

func (*Driver) Probe added in v0.8.1

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

func (*Driver) Run added in v0.8.1

func (d *Driver) Run(ctx context.Context) error

type Interface

type Interface interface {
	// Run the CSI driver gRPC server
	Run(ctx context.Context) error
}

Interface is the CloudStack CSI driver interface.

type Mode added in v0.6.0

type Mode string

Mode is the operating mode of the CSI driver.

const (
	// ControllerMode is the mode that only starts the controller service.
	ControllerMode Mode = "controller"
	// NodeMode is the mode that only starts the node service.
	NodeMode Mode = "node"
	// AllMode is the mode that only starts both the controller and the node service.
	AllMode Mode = "all"
)

Driver operating modes.

type NodeService added in v0.8.1

type NodeService struct {
	csi.UnimplementedNodeServer
	// contains filtered or unexported fields
}

NodeService represents the node service of CSI driver.

func NewNodeService added in v0.8.1

func NewNodeService(connector cloud.Cloud, mounter mount.Mounter, options *Options) *NodeService

NewNodeService creates a new node service.

func (*NodeService) NodeExpandVolume added in v0.8.1

func (*NodeService) NodeGetCapabilities added in v0.8.1

func (*NodeService) NodeGetInfo added in v0.8.1

func (*NodeService) NodeGetVolumeStats added in v0.8.1

func (*NodeService) NodePublishVolume added in v0.8.1

func (*NodeService) NodeStageVolume added in v0.8.1

func (*NodeService) NodeUnpublishVolume added in v0.8.1

func (*NodeService) NodeUnstageVolume added in v0.8.1

type Options added in v0.6.0

type Options struct {
	Mode Mode

	// Endpoint is the endpoint for the CSI driver server
	Endpoint string

	// CloudStackConfig is the path to the CloudStack configuration file
	CloudStackConfig string

	// NodeName is used to retrieve the node instance ID in case metadata lookup fails.
	NodeName string

	// VolumeAttachLimit specifies the value that shall be reported as "maximum number of attachable volumes"
	// in CSINode objects. It is similar to https://kubernetes.io/docs/concepts/storage/storage-limits/#custom-limits
	// which allowed administrators to specify custom volume limits by configuring the kube-scheduler.
	VolumeAttachLimit int64
}

Options contains options and configuration settings for the driver.

func (*Options) AddFlags added in v0.6.0

func (o *Options) AddFlags(f *flag.FlagSet)

func (*Options) Validate added in v0.6.0

func (o *Options) Validate() error

type Topology

type Topology struct {
	ZoneID string
	HostID string
}

Topology represents CloudStack storage topology.

func NewTopology

func NewTopology(t *csi.Topology) (Topology, error)

NewTopology converts a *csi.Topology to Topology.

func (Topology) ToCSI

func (t Topology) ToCSI() *csi.Topology

ToCSI converts a Topology to a *csi.Topology.

type VersionInfo added in v0.6.0

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"`
}

func GetVersion added in v0.6.0

func GetVersion() VersionInfo

Jump to

Keyboard shortcuts

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