driver

package
v0.0.0-...-cebfaed Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2023 License: Apache-2.0 Imports: 44 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MB = 1000 * 1000
	GB = 1000 * 1000 * 1000
	Mi = 1024 * 1024
	Gi = 1024 * 1024 * 1024

	AnnoSelectedNode          = "volume.kubernetes.io/selected-node"
	KubernetesNodeIdentityKey = "kubernetes.io/hostname"
	VolumeGroupName           = "csi.io/volume-group-name"
)

size constants

View Source
const (
	MPName = "MountPoint"
)

Variables

SupportedVolumeCapabilityAccessModes contains the list of supported access modes for the volume

Functions

func GetClientFromCacheOrCreate

func GetClientFromCacheOrCreate() (*kubernetes.Clientset, error)

func GetNodeIP

func GetNodeIP(node *v1.Node, nodeID string) (net.IP, error)

GetNodeIP get node address

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(d *CSIDriver) *controller

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 NewNodeServer

func NewNodeServer(d *CSIDriver) csi.NodeServer

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 TODO check if this can be renamed to Base

func New

func New(config *config.Config) *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 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

NewNonBlockingGRPCServer returns a new instance of NonBlockingGRPCServer

type SnapshotParams

type SnapshotParams struct {
	SnapSize    float64
	AbsSnapSize bool
}

SnapshotParams holds collection of supported settings that can be configured in snapshot class.

func NewSnapshotParams

func NewSnapshotParams(m map[string]string) (*SnapshotParams, error)

NewSnapshotParams parses the input params and instantiates new SnapshotParams.

type VolumeParams

type VolumeParams struct {
	PvcName string

	PvcNamespace string

	PvName string
	// HostPath specifies hostpath to use for
	// provisioning logical volumes.
	HostPath string
}

VolumeParams holds collection of supported settings that can be configured in storage class.

func NewVolumeParams

func NewVolumeParams(m map[string]string) (*VolumeParams, error)

NewVolumeParams parses the input params and instantiates new VolumeParams.

Jump to

Keyboard shortcuts

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