Documentation ¶
Index ¶
- Constants
- Variables
- func GetVolumeCapabilityAccessModes() []*csi.VolumeCapability_AccessMode
- func IsSupportedVolumeCapabilityAccessMode(accessMode csi.VolumeCapability_AccessMode_Mode) bool
- func NewController(cli *client.Client) csi.ControllerServer
- func NewIdentity(d *CSIDriver) csi.IdentityServer
- func NewNode(d *CSIDriver, cli *client.Client) *node
- type CSIDriver
- type NodeMounter
- type NonBlockingGRPCServer
- type Optfunc
Constants ¶
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" )
const ( // MonitorMountRetryTimeout indicates the time gap between two consecutive //monitoring attempts MonitorMountRetryTimeout = 5 )
Variables ¶
var ( // ValidFSTypes is the supported filesystem by the jiva-csi driver ValidFSTypes = []string{FSTypeExt2, FSTypeExt3, FSTypeExt4, FSTypeXfs} // MaxRetryCount is the retry count to check if volume is ready during // nodeStage RPC call MaxRetryCount int )
var SupportedVolumeCapabilityAccessModes = []*csi.VolumeCapability_AccessMode{ &csi.VolumeCapability_AccessMode{ Mode: csi.VolumeCapability_AccessMode_SINGLE_NODE_WRITER, }, }
SupportedVolumeCapabilityAccessModes contains the list of supported access modes for the volume
var SupportedVolumeCapabilityAccessType = []*csi.VolumeCapability_Mount{ &csi.VolumeCapability_Mount{ Mount: &csi.VolumeCapability_MountVolume{}, }, }
Functions ¶
func GetVolumeCapabilityAccessModes ¶
func GetVolumeCapabilityAccessModes() []*csi.VolumeCapability_AccessMode
GetVolumeCapabilityAccessModes fetches the access modes on which the volume can be exposed
func IsSupportedVolumeCapabilityAccessMode ¶
func IsSupportedVolumeCapabilityAccessMode( accessMode csi.VolumeCapability_AccessMode_Mode, ) bool
IsSupportedVolumeCapabilityAccessMode valides the requested access mode
func NewController ¶
func NewController(cli *client.Client) csi.ControllerServer
NewController returns a new instance of CSI controller
func NewIdentity ¶
func NewIdentity(d *CSIDriver) csi.IdentityServer
NewIdentity returns a new instance of CSI IdentityServer
Types ¶
type CSIDriver ¶
type CSIDriver struct {
// contains filtered or unexported fields
}
CSIDriver defines a common data structure for drivers
type NodeMounter ¶
type NodeMounter struct { mount.SafeFormatAndMount // contains filtered or unexported fields }
NodeMounter embeds the SafeFormatAndMount struct
func (*NodeMounter) GetDeviceName ¶
func (m *NodeMounter) GetDeviceName(mountPath string) (string, int, error)
GetDeviceName get the device name from the mount path
func (*NodeMounter) MonitorMounts ¶
func (n *NodeMounter) MonitorMounts()
MonitorMounts makes sure that all the volumes present in the inmemory list with the driver are mounted with the original mount options This function runs a never ending loop therefore should be run as a goroutine Mounted list is fetched from the OS and the state of all the volumes is reverified after every 5 seconds. If the mountpoint is not present in the list or if it has been remounted with a different mount option by the OS, the volume is added to the ReqMountList which is removed as soon as the remount operation on the volume is complete For each remount operation a new goroutine is created, so that if multiple volumes have lost their original state they can all be remounted in parallel
type NonBlockingGRPCServer ¶
type NonBlockingGRPCServer interface { // Start services at the endpoint Start() // Waits for the service to stop Wait() // Stops the service gracefully Stop() // Stops the service forcefully ForceStop() }
NonBlockingGRPCServer defines Non blocking GRPC server interfaces
func NewNonBlockingGRPCServer ¶
func NewNonBlockingGRPCServer(ep string, ids csi.IdentityServer, cs csi.ControllerServer, ns csi.NodeServer) NonBlockingGRPCServer
NewNonBlockingGRPCServer returns a new instance of NonBlockingGRPCServer
type Optfunc ¶
type Optfunc func(*NodeMounter)