driver

package
v1.12.1 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2020 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

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 (
	// MonitorMountRetryTimeout indicates the time gap between two consecutive
	//monitoring attempts
	MonitorMountRetryTimeout = 5
)

Variables

View Source
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
)

SupportedVolumeCapabilityAccessModes contains the list of supported access modes for the volume

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

func NewNode

func NewNode(d *CSIDriver, cli *client.Client) *node

NewNode returns a new instance of CSI NodeServer

Types

type CSIDriver

type CSIDriver struct {
	// contains filtered or unexported fields
}

CSIDriver defines a common data structure for drivers

func New

func New(config *config.Config, cli *client.Client) *CSIDriver

New returns a new driver instance

func (*CSIDriver) Run

func (d *CSIDriver) Run() error

Run starts the CSI plugin by communicating over the given endpoint

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL