Documentation ¶
Index ¶
- Constants
- Variables
- func CheckLuksPassphrase(exec k8sExec.Interface, devicePath string, passphrase string) bool
- func IsLuks(exec k8sExec.Interface, devicePath string) bool
- func IsLuksMapping(exec k8sExec.Interface, devicePath string) (bool, string, error)
- func LuksClose(mounter Mounter, encryptedDeviceName string) error
- func LuksFormat(exec k8sExec.Interface, devicePath string, passphrase string, ...) error
- func LuksOpen(exec Mounter, devicePath string, encryptedDeviceName string, passphrase string) (bool, error)
- func LuksResize(exec k8sExec.Interface, deviceName string, passphrase string) error
- func ValidateDriverOptions(options *DriverOptions) error
- func WithEndpoint(endpoint string) func(*DriverOptions)
- func WithExtraVolumeTags(extraVolumeTags map[string]string) func(*DriverOptions)
- func WithMode(mode Mode) func(*DriverOptions)
- type Driver
- func (d *Driver) ControllerExpandVolume(ctx context.Context, req *csi.ControllerExpandVolumeRequest) (*csi.ControllerExpandVolumeResponse, error)
- func (d *Driver) ControllerGetCapabilities(ctx context.Context, req *csi.ControllerGetCapabilitiesRequest) (*csi.ControllerGetCapabilitiesResponse, error)
- func (d *Driver) ControllerGetVolume(ctx context.Context, req *csi.ControllerGetVolumeRequest) (*csi.ControllerGetVolumeResponse, error)
- func (d *Driver) ControllerPublishVolume(ctx context.Context, req *csi.ControllerPublishVolumeRequest) (*csi.ControllerPublishVolumeResponse, error)
- func (d *Driver) ControllerUnpublishVolume(ctx context.Context, req *csi.ControllerUnpublishVolumeRequest) (*csi.ControllerUnpublishVolumeResponse, error)
- func (d *Driver) CreateSnapshot(ctx context.Context, req *csi.CreateSnapshotRequest) (*csi.CreateSnapshotResponse, error)
- func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest) (*csi.CreateVolumeResponse, error)
- func (d *Driver) DeleteSnapshot(ctx context.Context, req *csi.DeleteSnapshotRequest) (*csi.DeleteSnapshotResponse, error)
- func (d *Driver) DeleteVolume(ctx context.Context, req *csi.DeleteVolumeRequest) (*csi.DeleteVolumeResponse, error)
- func (d *Driver) GetCapacity(ctx context.Context, req *csi.GetCapacityRequest) (*csi.GetCapacityResponse, error)
- 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) ListSnapshots(ctx context.Context, req *csi.ListSnapshotsRequest) (*csi.ListSnapshotsResponse, error)
- func (d *Driver) ListVolumes(ctx context.Context, req *csi.ListVolumesRequest) (*csi.ListVolumesResponse, error)
- func (d *Driver) NodeExpandVolume(ctx context.Context, req *csi.NodeExpandVolumeRequest) (*csi.NodeExpandVolumeResponse, error)
- func (d *Driver) NodeGetCapabilities(ctx context.Context, req *csi.NodeGetCapabilitiesRequest) (*csi.NodeGetCapabilitiesResponse, error)
- func (d *Driver) NodeGetInfo(ctx context.Context, req *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error)
- func (d *Driver) NodeGetVolumeStats(ctx context.Context, req *csi.NodeGetVolumeStatsRequest) (*csi.NodeGetVolumeStatsResponse, error)
- func (d *Driver) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error)
- func (d *Driver) NodeStageVolume(ctx context.Context, req *csi.NodeStageVolumeRequest) (*csi.NodeStageVolumeResponse, error)
- func (d *Driver) NodeUnpublishVolume(ctx context.Context, req *csi.NodeUnpublishVolumeRequest) (*csi.NodeUnpublishVolumeResponse, error)
- func (d *Driver) NodeUnstageVolume(ctx context.Context, req *csi.NodeUnstageVolumeRequest) (*csi.NodeUnstageVolumeResponse, error)
- func (d *Driver) Probe(ctx context.Context, req *csi.ProbeRequest) (*csi.ProbeResponse, error)
- func (d *Driver) Run() error
- func (d *Driver) Stop()
- func (d *Driver) ValidateVolumeCapabilities(ctx context.Context, req *csi.ValidateVolumeCapabilitiesRequest) (*csi.ValidateVolumeCapabilitiesResponse, error)
- type DriverOptions
- type Mode
- type Mounter
- type NodeMounter
- func (m *NodeMounter) CheckLuksPassphrase(devicePath string, passphrase string) bool
- func (m *NodeMounter) ExistsPath(filename string) (bool, error)
- func (m *NodeMounter) GetDeviceName(mountPath string) (string, int, error)
- func (m NodeMounter) IsCorruptedMnt(err error) bool
- func (m *NodeMounter) IsLuks(devicePath string) bool
- func (m *NodeMounter) IsLuksMapping(devicePath string) (bool, string, error)
- func (m *NodeMounter) LuksClose(deviceName string) error
- func (m *NodeMounter) LuksFormat(devicePath string, passphrase string, context luks.LuksContext) error
- func (m *NodeMounter) LuksOpen(devicePath string, encryptedDeviceName string, passphrase string) (bool, error)
- func (m *NodeMounter) LuksResize(deviceName string, passphrase string) error
- func (m *NodeMounter) MakeDir(pathname string) error
- func (m *NodeMounter) MakeFile(pathname string) error
Constants ¶
View Source
const ( // VolumeTypeKey represents key for volume type VolumeTypeKey = "type" // IopsPerGBKey represents key for IOPS per GB IopsPerGBKey = "iopspergb" // EncryptedKey represents key for whether filesystem is encrypted EncryptedKey = "encrypted" // KmsKeyId represents key for KMS encryption key KmsKeyIDKey = "kmskeyid" // LuksCipherKey represents the cipher used in LUKS LuksCipherKey = "luks-cipher" // LuksHashKey represents the hash algorithm used for password derivation in LUKS LuksHashKey = "luks-hash" // LuksKeySizeKey represents the size of the key used in LUKS LuksKeySizeKey = "luks-key-size" // LuksPassphraseKey represents the passphrase LUKS LuksPassphraseKey = "key" )
constants of keys in volume parameters
View Source
const ( DriverName = "bsu.csi.outscale.com" TopologyKey = "topology." + DriverName + "/zone" TopologyK8sKey = "topology.kubernetes.io/zone" )
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 te xfs filesystem type FSTypeXfs = "xfs" )
View Source
const (
DefaultCSIEndpoint = "unix://tmp/csi.sock"
)
constants for default command line flag values
View Source
const ( // devicePathKey represents key for device path in PublishContext // devicePath is the device path where the volume is attached to DevicePathKey = "devicePath" )
constants of keys in PublishContext
Variables ¶
View Source
var ( // NewMetadataFunc is a variable for the cloud.NewMetadata function that can // be overwritten in unit tests. NewMetadataFunc = cloud.NewMetadata // NewCloudFunc is a variable for the cloud.NewCloud function that can // be overwritten in unit tests. NewCloudFunc = cloud.NewCloud )
View Source
var (
ValidFSTypes = []string{FSTypeExt2, FSTypeExt3, FSTypeExt4, FSTypeXfs}
)
Functions ¶
func CheckLuksPassphrase ¶ added in v1.1.0
func IsLuksMapping ¶ added in v1.1.0
func LuksFormat ¶ added in v1.1.0
func LuksResize ¶ added in v1.1.0
func ValidateDriverOptions ¶
func ValidateDriverOptions(options *DriverOptions) error
func WithEndpoint ¶
func WithEndpoint(endpoint string) func(*DriverOptions)
func WithExtraVolumeTags ¶
func WithExtraVolumeTags(extraVolumeTags map[string]string) func(*DriverOptions)
func WithMode ¶
func WithMode(mode Mode) func(*DriverOptions)
Types ¶
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
func NewDriver ¶
func NewDriver(options ...func(*DriverOptions)) (*Driver, error)
func (*Driver) ControllerExpandVolume ¶
func (d *Driver) ControllerExpandVolume(ctx context.Context, req *csi.ControllerExpandVolumeRequest) (*csi.ControllerExpandVolumeResponse, error)
Expand not implemented
func (*Driver) ControllerGetCapabilities ¶
func (d *Driver) ControllerGetCapabilities(ctx context.Context, req *csi.ControllerGetCapabilitiesRequest) (*csi.ControllerGetCapabilitiesResponse, error)
func (*Driver) ControllerGetVolume ¶
func (d *Driver) ControllerGetVolume(ctx context.Context, req *csi.ControllerGetVolumeRequest) (*csi.ControllerGetVolumeResponse, error)
func (*Driver) ControllerPublishVolume ¶
func (d *Driver) ControllerPublishVolume(ctx context.Context, req *csi.ControllerPublishVolumeRequest) (*csi.ControllerPublishVolumeResponse, error)
func (*Driver) ControllerUnpublishVolume ¶
func (d *Driver) ControllerUnpublishVolume(ctx context.Context, req *csi.ControllerUnpublishVolumeRequest) (*csi.ControllerUnpublishVolumeResponse, error)
func (*Driver) CreateSnapshot ¶
func (d *Driver) CreateSnapshot(ctx context.Context, req *csi.CreateSnapshotRequest) (*csi.CreateSnapshotResponse, error)
func (*Driver) CreateVolume ¶
func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest) (*csi.CreateVolumeResponse, error)
func (*Driver) DeleteSnapshot ¶
func (d *Driver) DeleteSnapshot(ctx context.Context, req *csi.DeleteSnapshotRequest) (*csi.DeleteSnapshotResponse, error)
func (*Driver) DeleteVolume ¶
func (d *Driver) DeleteVolume(ctx context.Context, req *csi.DeleteVolumeRequest) (*csi.DeleteVolumeResponse, error)
func (*Driver) GetCapacity ¶
func (d *Driver) GetCapacity(ctx context.Context, req *csi.GetCapacityRequest) (*csi.GetCapacityResponse, error)
func (*Driver) GetPluginCapabilities ¶
func (d *Driver) GetPluginCapabilities(ctx context.Context, req *csi.GetPluginCapabilitiesRequest) (*csi.GetPluginCapabilitiesResponse, error)
func (*Driver) GetPluginInfo ¶
func (d *Driver) GetPluginInfo(ctx context.Context, req *csi.GetPluginInfoRequest) (*csi.GetPluginInfoResponse, error)
func (*Driver) ListSnapshots ¶
func (d *Driver) ListSnapshots(ctx context.Context, req *csi.ListSnapshotsRequest) (*csi.ListSnapshotsResponse, error)
func (*Driver) ListVolumes ¶
func (d *Driver) ListVolumes(ctx context.Context, req *csi.ListVolumesRequest) (*csi.ListVolumesResponse, error)
func (*Driver) NodeExpandVolume ¶
func (d *Driver) NodeExpandVolume(ctx context.Context, req *csi.NodeExpandVolumeRequest) (*csi.NodeExpandVolumeResponse, error)
func (*Driver) NodeGetCapabilities ¶
func (d *Driver) NodeGetCapabilities(ctx context.Context, req *csi.NodeGetCapabilitiesRequest) (*csi.NodeGetCapabilitiesResponse, error)
func (*Driver) NodeGetInfo ¶
func (d *Driver) NodeGetInfo(ctx context.Context, req *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error)
func (*Driver) NodeGetVolumeStats ¶
func (d *Driver) NodeGetVolumeStats(ctx context.Context, req *csi.NodeGetVolumeStatsRequest) (*csi.NodeGetVolumeStatsResponse, error)
func (*Driver) NodePublishVolume ¶
func (d *Driver) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error)
func (*Driver) NodeStageVolume ¶
func (d *Driver) NodeStageVolume(ctx context.Context, req *csi.NodeStageVolumeRequest) (*csi.NodeStageVolumeResponse, error)
func (*Driver) NodeUnpublishVolume ¶
func (d *Driver) NodeUnpublishVolume(ctx context.Context, req *csi.NodeUnpublishVolumeRequest) (*csi.NodeUnpublishVolumeResponse, error)
func (*Driver) NodeUnstageVolume ¶
func (d *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)
func (*Driver) ValidateVolumeCapabilities ¶
func (d *Driver) ValidateVolumeCapabilities(ctx context.Context, req *csi.ValidateVolumeCapabilitiesRequest) (*csi.ValidateVolumeCapabilitiesResponse, error)
type DriverOptions ¶
type DriverOptions struct {
// contains filtered or unexported fields
}
type Mode ¶
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" )
type Mounter ¶
type Mounter interface { mount.Interface exec.Interface luks.LuksService FormatAndMount(source string, target string, fstype string, options []string) error GetDiskFormat(disk string) (string, error) GetDeviceName(mountPath string) (string, int, error) MakeFile(pathname string) error MakeDir(pathname string) error ExistsPath(filename string) (bool, error) IsCorruptedMnt(error) bool }
Mounter is an interface for mount operations
type NodeMounter ¶
type NodeMounter struct { mount.SafeFormatAndMount exec.Interface }
func (*NodeMounter) CheckLuksPassphrase ¶ added in v1.1.0
func (m *NodeMounter) CheckLuksPassphrase(devicePath string, passphrase string) bool
func (*NodeMounter) ExistsPath ¶
func (m *NodeMounter) ExistsPath(filename string) (bool, error)
func (*NodeMounter) GetDeviceName ¶
func (m *NodeMounter) GetDeviceName(mountPath string) (string, int, error)
func (NodeMounter) IsCorruptedMnt ¶
func (m NodeMounter) IsCorruptedMnt(err error) bool
func (*NodeMounter) IsLuks ¶ added in v1.1.0
func (m *NodeMounter) IsLuks(devicePath string) bool
func (*NodeMounter) IsLuksMapping ¶ added in v1.1.0
func (m *NodeMounter) IsLuksMapping(devicePath string) (bool, string, error)
func (*NodeMounter) LuksClose ¶ added in v1.1.0
func (m *NodeMounter) LuksClose(deviceName string) error
func (*NodeMounter) LuksFormat ¶ added in v1.1.0
func (m *NodeMounter) LuksFormat(devicePath string, passphrase string, context luks.LuksContext) error
func (*NodeMounter) LuksResize ¶ added in v1.1.0
func (m *NodeMounter) LuksResize(deviceName string, passphrase string) error
func (*NodeMounter) MakeDir ¶
func (m *NodeMounter) MakeDir(pathname string) error
func (*NodeMounter) MakeFile ¶
func (m *NodeMounter) MakeFile(pathname string) error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.