driver

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2024 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)

func NewControllerServer

func NewControllerServer(connector cloud.Interface) csi.ControllerServer

NewControllerServer creates a new Controller gRPC server.

func NewNodeServer

func NewNodeServer(connector cloud.Interface, mounter mount.Interface, options *Options) csi.NodeServer

NewNodeServer creates a new Node gRPC server.

Types

type Interface

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

Interface is the CloudStack CSI driver interface.

func New

func New(ctx context.Context, csConnector cloud.Interface, options *Options, mounter mount.Interface) (Interface, error)

New instantiates a new CloudStack CSI driver.

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 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