Documentation
¶
Overview ¶
Package driver provides the implementation of the CSI plugin.
It contains the gRPC server implementation of CSI specification.
Index ¶
- Constants
- Variables
- func GetVersionJSON() (string, error)
- type ControllerService
- func (cs *ControllerService) ControllerExpandVolume(ctx context.Context, req *csi.ControllerExpandVolumeRequest) (*csi.ControllerExpandVolumeResponse, error)
- func (cs *ControllerService) ControllerGetCapabilities(ctx context.Context, req *csi.ControllerGetCapabilitiesRequest) (*csi.ControllerGetCapabilitiesResponse, error)
- func (cs *ControllerService) ControllerPublishVolume(ctx context.Context, req *csi.ControllerPublishVolumeRequest) (*csi.ControllerPublishVolumeResponse, error)
- func (cs *ControllerService) ControllerUnpublishVolume(ctx context.Context, req *csi.ControllerUnpublishVolumeRequest) (*csi.ControllerUnpublishVolumeResponse, error)
- func (cs *ControllerService) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest) (*csi.CreateVolumeResponse, error)
- func (cs *ControllerService) DeleteVolume(ctx context.Context, req *csi.DeleteVolumeRequest) (*csi.DeleteVolumeResponse, error)
- func (cs *ControllerService) ValidateVolumeCapabilities(ctx context.Context, req *csi.ValidateVolumeCapabilitiesRequest) (*csi.ValidateVolumeCapabilitiesResponse, error)
- type Driver
- func (d *Driver) GetPluginCapabilities(ctx context.Context, req *csi.GetPluginCapabilitiesRequest) (*csi.GetPluginCapabilitiesResponse, error)
- func (d *Driver) GetPluginInfo(ctx context.Context, req *csi.GetPluginInfoRequest) (*csi.GetPluginInfoResponse, error)
- func (d *Driver) Probe(ctx context.Context, req *csi.ProbeRequest) (*csi.ProbeResponse, error)
- func (d *Driver) Run(ctx context.Context) error
- type Interface
- type Mode
- type NodeService
- func (ns *NodeService) NodeExpandVolume(ctx context.Context, req *csi.NodeExpandVolumeRequest) (*csi.NodeExpandVolumeResponse, error)
- func (ns *NodeService) NodeGetCapabilities(_ context.Context, _ *csi.NodeGetCapabilitiesRequest) (*csi.NodeGetCapabilitiesResponse, error)
- func (ns *NodeService) NodeGetInfo(ctx context.Context, req *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error)
- func (ns *NodeService) NodeGetVolumeStats(ctx context.Context, req *csi.NodeGetVolumeStatsRequest) (*csi.NodeGetVolumeStatsResponse, error)
- func (ns *NodeService) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error)
- func (ns *NodeService) NodeStageVolume(ctx context.Context, req *csi.NodeStageVolumeRequest) (*csi.NodeStageVolumeResponse, error)
- func (ns *NodeService) NodeUnpublishVolume(ctx context.Context, req *csi.NodeUnpublishVolumeRequest) (*csi.NodeUnpublishVolumeResponse, error)
- func (ns *NodeService) NodeUnstageVolume(ctx context.Context, req *csi.NodeUnstageVolumeRequest) (*csi.NodeUnstageVolumeResponse, error)
- type Options
- type Topology
- type VersionInfo
Constants ¶
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.
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.
const ( ZoneKey = "topology." + DriverName + "/zone" HostKey = "topology." + DriverName + "/host" )
Topology keys.
const (
DiskOfferingKey = DriverName + "/disk-offering-id"
)
Volume parameters keys.
const DriverName = "csi.cloudstack.apache.org"
DriverName is the name of the CSI plugin.
Variables ¶
var ValidFSTypes = map[string]struct{}{
FSTypeExt2: {},
FSTypeExt3: {},
FSTypeExt4: {},
FSTypeXfs: {},
}
Functions ¶
func GetVersionJSON ¶ added in v0.6.0
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 (cs *ControllerService) ControllerExpandVolume(ctx context.Context, req *csi.ControllerExpandVolumeRequest) (*csi.ControllerExpandVolumeResponse, error)
func (*ControllerService) ControllerGetCapabilities ¶ added in v0.8.1
func (cs *ControllerService) ControllerGetCapabilities(ctx context.Context, req *csi.ControllerGetCapabilitiesRequest) (*csi.ControllerGetCapabilitiesResponse, error)
func (*ControllerService) ControllerPublishVolume ¶ added in v0.8.1
func (cs *ControllerService) ControllerPublishVolume(ctx context.Context, req *csi.ControllerPublishVolumeRequest) (*csi.ControllerPublishVolumeResponse, error)
func (*ControllerService) ControllerUnpublishVolume ¶ added in v0.8.1
func (cs *ControllerService) ControllerUnpublishVolume(ctx context.Context, req *csi.ControllerUnpublishVolumeRequest) (*csi.ControllerUnpublishVolumeResponse, error)
func (*ControllerService) CreateVolume ¶ added in v0.8.1
func (cs *ControllerService) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest) (*csi.CreateVolumeResponse, error)
func (*ControllerService) DeleteVolume ¶ added in v0.8.1
func (cs *ControllerService) DeleteVolume(ctx context.Context, req *csi.DeleteVolumeRequest) (*csi.DeleteVolumeResponse, error)
func (*ControllerService) ValidateVolumeCapabilities ¶ added in v0.8.1
func (cs *ControllerService) ValidateVolumeCapabilities(ctx context.Context, req *csi.ValidateVolumeCapabilitiesRequest) (*csi.ValidateVolumeCapabilitiesResponse, error)
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 (d *Driver) GetPluginCapabilities(ctx context.Context, req *csi.GetPluginCapabilitiesRequest) (*csi.GetPluginCapabilitiesResponse, error)
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)
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
NewNodeService creates a new node service.
func (*NodeService) NodeExpandVolume ¶ added in v0.8.1
func (ns *NodeService) NodeExpandVolume(ctx context.Context, req *csi.NodeExpandVolumeRequest) (*csi.NodeExpandVolumeResponse, error)
func (*NodeService) NodeGetCapabilities ¶ added in v0.8.1
func (ns *NodeService) NodeGetCapabilities(_ context.Context, _ *csi.NodeGetCapabilitiesRequest) (*csi.NodeGetCapabilitiesResponse, error)
func (*NodeService) NodeGetInfo ¶ added in v0.8.1
func (ns *NodeService) NodeGetInfo(ctx context.Context, req *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error)
func (*NodeService) NodeGetVolumeStats ¶ added in v0.8.1
func (ns *NodeService) NodeGetVolumeStats(ctx context.Context, req *csi.NodeGetVolumeStatsRequest) (*csi.NodeGetVolumeStatsResponse, error)
func (*NodeService) NodePublishVolume ¶ added in v0.8.1
func (ns *NodeService) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error)
func (*NodeService) NodeStageVolume ¶ added in v0.8.1
func (ns *NodeService) NodeStageVolume(ctx context.Context, req *csi.NodeStageVolumeRequest) (*csi.NodeStageVolumeResponse, error)
func (*NodeService) NodeUnpublishVolume ¶ added in v0.8.1
func (ns *NodeService) NodeUnpublishVolume(ctx context.Context, req *csi.NodeUnpublishVolumeRequest) (*csi.NodeUnpublishVolumeResponse, error)
func (*NodeService) NodeUnstageVolume ¶ added in v0.8.1
func (ns *NodeService) NodeUnstageVolume(ctx context.Context, req *csi.NodeUnstageVolumeRequest) (*csi.NodeUnstageVolumeResponse, error)
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.
type Topology ¶
Topology represents CloudStack storage topology.
func NewTopology ¶
NewTopology converts a *csi.Topology to 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