Documentation ¶
Index ¶
- Constants
- func GetDeviceNameFromMountPath(mounter mount.Interface, mountPath string) (string, int, error)
- func GetVersionYAML(driverName string) (string, error)
- func IsCorruptedDir(dir string) bool
- func Mkdir(m *mount.SafeFormatAndMount, name string, perm os.FileMode) error
- func Mount(m *mount.SafeFormatAndMount, source, target, fsType string, options []string) error
- func NewFakeMounter() (*mount.SafeFormatAndMount, error)
- func Unmount(m *mount.SafeFormatAndMount, target string, extensiveMountPointCheck bool) error
- 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(context.Context, *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 (f *Driver) GetPluginCapabilities(ctx context.Context, req *csi.GetPluginCapabilitiesRequest) (*csi.GetPluginCapabilitiesResponse, error)
- func (f *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 (f *Driver) Probe(ctx context.Context, req *csi.ProbeRequest) (*csi.ProbeResponse, error)
- func (d *Driver) Run(endpoint string, testMode bool)
- func (d *Driver) ValidateVolumeCapabilities(ctx context.Context, req *csi.ValidateVolumeCapabilitiesRequest) (*csi.ValidateVolumeCapabilitiesResponse, error)
- type DriverOptions
- type VersionInfo
- type ZRAMDevice
- func (d *ZRAMDevice) FormatAndMount(mountPath, fsType string, options []string) error
- func (d *ZRAMDevice) GetDevPath() string
- func (d *ZRAMDevice) GetId() int
- func (d *ZRAMDevice) GetMounter() *mount.SafeFormatAndMount
- func (d *ZRAMDevice) GetSysPath() string
- func (d *ZRAMDevice) RefCount() (int, error)
- func (d *ZRAMDevice) Remove() error
- func (d *ZRAMDevice) Reset() error
- func (d *ZRAMDevice) SetCompAlgorithm(compAlgorithm string) error
- func (d *ZRAMDevice) SetDiskSize(diskSize int64) error
- func (d *ZRAMDevice) SetMaxCompStreams(maxCompStreams int) error
- func (d *ZRAMDevice) SetMemLimit(memLimit int64) error
- func (d *ZRAMDevice) UnmountAndCleanup() error
Constants ¶
const ( DefaultDriverName = "zram.csi.k8s.io" TopologyKeyNode = "topology.hostpath.csi/node" )
Variables ¶
This section is empty.
Functions ¶
func GetDeviceNameFromMountPath ¶
GetDeviceNameFromMount given a mnt point, find the device from /proc/mounts returns the device name, reference count, and error code.
func GetVersionYAML ¶
GetVersionYAML returns the version information of the driver in YAML format
func IsCorruptedDir ¶
func Mount ¶
func Mount(m *mount.SafeFormatAndMount, source, target, fsType string, options []string) error
func NewFakeMounter ¶
func NewFakeMounter() (*mount.SafeFormatAndMount, error)
Types ¶
type Driver ¶
Driver implements all interfaces of CSI drivers
func NewDriver ¶
func NewDriver(options *DriverOptions) *Driver
NewDriver Creates a NewCSIDriver object. Assumes vendor version is equal to driver version & does not support optional driver plugin info manifest field. Refer to CSI spec for more details.
func (*Driver) ControllerExpandVolume ¶
func (d *Driver) ControllerExpandVolume(ctx context.Context, req *csi.ControllerExpandVolumeRequest) (*csi.ControllerExpandVolumeResponse, error)
ControllerExpandVolume expand volume
func (*Driver) ControllerGetCapabilities ¶
func (d *Driver) ControllerGetCapabilities(ctx context.Context, req *csi.ControllerGetCapabilitiesRequest) (*csi.ControllerGetCapabilitiesResponse, error)
ControllerGetCapabilities returns the capabilities of the Controller plugin
func (*Driver) ControllerGetVolume ¶
func (d *Driver) ControllerGetVolume(context.Context, *csi.ControllerGetVolumeRequest) (*csi.ControllerGetVolumeResponse, error)
ControllerGetVolume get volume
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)
DeleteVolume only supports static provisioning, no delete volume action
func (*Driver) GetCapacity ¶
func (d *Driver) GetCapacity(ctx context.Context, req *csi.GetCapacityRequest) (*csi.GetCapacityResponse, error)
GetCapacity returns the capacity of the total available storage pool
func (*Driver) GetPluginCapabilities ¶
func (f *Driver) GetPluginCapabilities(ctx context.Context, req *csi.GetPluginCapabilitiesRequest) (*csi.GetPluginCapabilitiesResponse, error)
GetPluginCapabilities returns the capabilities of the plugin
func (*Driver) GetPluginInfo ¶
func (f *Driver) GetPluginInfo(ctx context.Context, req *csi.GetPluginInfoRequest) (*csi.GetPluginInfoResponse, error)
GetPluginInfo return the version and name of the plugin
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)
ListVolumes return all available volumes
func (*Driver) NodeExpandVolume ¶
func (d *Driver) NodeExpandVolume(ctx context.Context, req *csi.NodeExpandVolumeRequest) (*csi.NodeExpandVolumeResponse, error)
NodeExpandVolume node expand volume N/A for zram
func (*Driver) NodeGetCapabilities ¶
func (d *Driver) NodeGetCapabilities(ctx context.Context, req *csi.NodeGetCapabilitiesRequest) (*csi.NodeGetCapabilitiesResponse, error)
NodeGetCapabilities return the capabilities of the Node plugin
func (*Driver) NodeGetInfo ¶
func (d *Driver) NodeGetInfo(ctx context.Context, req *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error)
NodeGetInfo return info of the node on which this plugin is running
func (*Driver) NodeGetVolumeStats ¶
func (d *Driver) NodeGetVolumeStats(ctx context.Context, req *csi.NodeGetVolumeStatsRequest) (*csi.NodeGetVolumeStatsResponse, error)
NodeGetVolumeStats get volume stats
func (*Driver) NodePublishVolume ¶
func (d *Driver) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error)
NodePublishVolume mount the volume from staging to target path
func (*Driver) NodeStageVolume ¶
func (d *Driver) NodeStageVolume(ctx context.Context, req *csi.NodeStageVolumeRequest) (*csi.NodeStageVolumeResponse, error)
NodeStageVolume mount the volume to a staging path
func (*Driver) NodeUnpublishVolume ¶
func (d *Driver) NodeUnpublishVolume(ctx context.Context, req *csi.NodeUnpublishVolumeRequest) (*csi.NodeUnpublishVolumeResponse, error)
NodeUnpublishVolume unmount the volume from the target path
func (*Driver) NodeUnstageVolume ¶
func (d *Driver) NodeUnstageVolume(ctx context.Context, req *csi.NodeUnstageVolumeRequest) (*csi.NodeUnstageVolumeResponse, error)
NodeUnstageVolume unmount the volume from the staging path
func (*Driver) Probe ¶
func (f *Driver) Probe(ctx context.Context, req *csi.ProbeRequest) (*csi.ProbeResponse, error)
Probe check whether the plugin is running or not. This method does not need to return anything. Currently the spec does not dictate what you should return either. Hence, return an empty response
func (*Driver) ValidateVolumeCapabilities ¶
func (d *Driver) ValidateVolumeCapabilities(ctx context.Context, req *csi.ValidateVolumeCapabilitiesRequest) (*csi.ValidateVolumeCapabilitiesResponse, error)
type DriverOptions ¶
type DriverOptions struct { NodeID string DriverName string EnableGetVolumeStats bool EnableTopology bool WorkingMountDir string }
DriverOptions defines driver parameters specified in driver deployment
type VersionInfo ¶
type VersionInfo struct { DriverName string `json:"Driver Name"` DriverVersion string `json:"Driver Version"` GitCommit string `json:"Git Commit"` BuildDate string `json:"Build Date"` GoVersion string `json:"Go Version"` Compiler string `json:"Compiler"` Platform string `json:"Platform"` }
VersionInfo holds the version information of the driver
func GetVersion ¶
func GetVersion(driverName string) VersionInfo
GetVersion returns the version information of the driver
type ZRAMDevice ¶
type ZRAMDevice struct {
// contains filtered or unexported fields
}
func NewZRAMDevice ¶
func NewZRAMDevice() (*ZRAMDevice, error)
func NewZRAMDeviceFromId ¶
func NewZRAMDeviceFromId(id int) (*ZRAMDevice, error)
func NewZRAMDeviceFromMountPath ¶
func NewZRAMDeviceFromMountPath(mountPath string) (*ZRAMDevice, error)
func (*ZRAMDevice) FormatAndMount ¶
func (d *ZRAMDevice) FormatAndMount(mountPath, fsType string, options []string) error
func (*ZRAMDevice) GetDevPath ¶
func (d *ZRAMDevice) GetDevPath() string
func (*ZRAMDevice) GetId ¶
func (d *ZRAMDevice) GetId() int
func (*ZRAMDevice) GetMounter ¶
func (d *ZRAMDevice) GetMounter() *mount.SafeFormatAndMount
func (*ZRAMDevice) GetSysPath ¶
func (d *ZRAMDevice) GetSysPath() string
func (*ZRAMDevice) RefCount ¶
func (d *ZRAMDevice) RefCount() (int, error)
func (*ZRAMDevice) Remove ¶
func (d *ZRAMDevice) Remove() error
func (*ZRAMDevice) Reset ¶
func (d *ZRAMDevice) Reset() error
func (*ZRAMDevice) SetCompAlgorithm ¶
func (d *ZRAMDevice) SetCompAlgorithm(compAlgorithm string) error
func (*ZRAMDevice) SetDiskSize ¶
func (d *ZRAMDevice) SetDiskSize(diskSize int64) error
func (*ZRAMDevice) SetMaxCompStreams ¶
func (d *ZRAMDevice) SetMaxCompStreams(maxCompStreams int) error
func (*ZRAMDevice) SetMemLimit ¶
func (d *ZRAMDevice) SetMemLimit(memLimit int64) error
func (*ZRAMDevice) UnmountAndCleanup ¶
func (d *ZRAMDevice) UnmountAndCleanup() error