driver

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2024 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// VolumeTags is a comma seperated string used to pass information to the linode APIs to tag the
	// created volumes
	VolumeTags = driverName + "/volumeTags"

	// PublishInfoVolumeName is used to pass the volume name from
	// `ControllerPublishVolume` to `NodeStageVolume or `NodePublishVolume`
	PublishInfoVolumeName = driverName + "/volume-name"

	VolumeLifecycleNodeStageVolume     VolumeLifecycle = "NodeStageVolume"
	VolumeLifecycleNodePublishVolume   VolumeLifecycle = "NodePublishVolume"
	VolumeLifecycleNodeUnstageVolume   VolumeLifecycle = "NodeUnstageVolume"
	VolumeLifecycleNodeUnpublishVolume VolumeLifecycle = "NodeUnpublishVolume"

	// Linode Volume Topology Region Label
	VolumeTopologyRegion string = "topology.linode.com/region"
)
View Source
const (
	// LuksEncryptedAttribute is used to pass the information if the volume should be
	// encrypted with luks to `NodeStageVolume`
	LuksEncryptedAttribute = driverName + "/luks-encrypted"

	// LuksCipherAttribute is used to pass the information about the luks encryption
	// cipher to `NodeStageVolume`
	LuksCipherAttribute = driverName + "/luks-cipher"

	// LuksKeySizeAttribute is used to pass the information about the luks key size
	// to `NodeStageVolume`
	LuksKeySizeAttribute = driverName + "/luks-key-size"

	// LuksKeyAttribute is the key of the luks key used in the map of secrets passed from the CO
	LuksKeyAttribute = "luksKey"
)
View Source
const LinodeIDPath = "/linode-info/linode-id"

LinodeIDPath is the path to a file containing only the ID of the Linode instance the CSI node plugin is currently running on. This file is expected to be placed into the Linode by the init container provided with the CSI node plugin.

Variables

This section is empty.

Functions

func ControllerServiceCapabilities

func ControllerServiceCapabilities() []*csi.ControllerServiceCapability

ControllerServiceCapabilities returns the list of capabilities supported by this driver's controller service.

func NodeServiceCapabilities

func NodeServiceCapabilities() []*csi.NodeServiceCapability

NodeServiceCapabilities returns the list of capabilities supported by this driver's node service.

func VolumeCapabilityAccessModes

func VolumeCapabilityAccessModes() []*csi.VolumeCapability_AccessMode

VolumeCapabilityAccessModes returns the allowed access modes for a volume created by the driver.

Types

type LinodeControllerServer

type LinodeControllerServer struct {
	Driver        *LinodeDriver
	CloudProvider linodeclient.LinodeClient
	Metadata      Metadata
}

func NewControllerServer

func NewControllerServer(linodeDriver *LinodeDriver, cloudProvider linodeclient.LinodeClient, metadata Metadata) *LinodeControllerServer

func (*LinodeControllerServer) ControllerExpandVolume

func (*LinodeControllerServer) ControllerGetCapabilities

ControllerGetCapabilities returns the supported capabilities of controller service provided by this Plugin

func (*LinodeControllerServer) ControllerGetVolume

ControllerGetVolume allows probing for health status

func (*LinodeControllerServer) ControllerPublishVolume

ControllerPublishVolume attaches the given volume to the node

func (*LinodeControllerServer) ControllerUnpublishVolume

ControllerUnpublishVolume deattaches the given volume from the node

func (*LinodeControllerServer) CreateSnapshot

func (*LinodeControllerServer) CreateVolume

CreateVolume will be called by the CO to provision a new volume on behalf of a user (to be consumed as either a block device or a mounted filesystem). This operation is idempotent.

func (*LinodeControllerServer) DeleteSnapshot

func (*LinodeControllerServer) DeleteVolume

DeleteVolume deletes the given volume. The function is idempotent.

func (*LinodeControllerServer) GetCapacity

func (*LinodeControllerServer) ListSnapshots

func (*LinodeControllerServer) ListVolumes

ListVolumes shall return information about all the volumes the provider knows about

func (*LinodeControllerServer) ValidateVolumeCapabilities

ValidateVolumeCapabilities checks whether the volume capabilities requested are supported.

type LinodeDriver

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

func GetLinodeDriver

func GetLinodeDriver() *LinodeDriver

func (*LinodeDriver) Run

func (linodeDriver *LinodeDriver) Run(endpoint string)

func (*LinodeDriver) SetupLinodeDriver

func (linodeDriver *LinodeDriver) SetupLinodeDriver(
	linodeClient linodeclient.LinodeClient,
	mounter *mount.SafeFormatAndMount,
	deviceUtils mountmanager.DeviceUtils,
	metadata Metadata,
	name,
	vendorVersion,
	bsPrefix string,
) error

func (*LinodeDriver) ValidateControllerServiceRequest

func (linodeDriver *LinodeDriver) ValidateControllerServiceRequest(c csi.ControllerServiceCapability_RPC_Type) error

type LinodeIdentityServer

type LinodeIdentityServer struct {
	Driver *LinodeDriver
}

func NewIdentityServer

func NewIdentityServer(linodeDriver *LinodeDriver) *LinodeIdentityServer

func (*LinodeIdentityServer) GetPluginCapabilities

func (linodeIdentity *LinodeIdentityServer) GetPluginCapabilities(ctx context.Context, req *csi.GetPluginCapabilitiesRequest) (*csi.GetPluginCapabilitiesResponse, error)

func (*LinodeIdentityServer) GetPluginInfo

func (linodeIdentity *LinodeIdentityServer) GetPluginInfo(ctx context.Context, req *csi.GetPluginInfoRequest) (*csi.GetPluginInfoResponse, error)

GetPluginInfo(context.Context, *GetPluginInfoRequest) (*GetPluginInfoResponse, error)

func (*LinodeIdentityServer) Probe

func (linodeIdentity *LinodeIdentityServer) Probe(ctx context.Context, req *csi.ProbeRequest) (*csi.ProbeResponse, error)

type LinodeNodeServer

type LinodeNodeServer struct {
	Driver        *LinodeDriver
	Mounter       *mount.SafeFormatAndMount
	DeviceUtils   mountmanager.DeviceUtils
	CloudProvider linodeclient.LinodeClient
	Metadata      Metadata
	// contains filtered or unexported fields
}

func NewNodeServer

func NewNodeServer(linodeDriver *LinodeDriver, mounter *mount.SafeFormatAndMount, deviceUtils mountmanager.DeviceUtils, cloudProvider linodeclient.LinodeClient, metadata Metadata) *LinodeNodeServer

func (*LinodeNodeServer) NodeExpandVolume

func (*LinodeNodeServer) NodeGetCapabilities

func (*LinodeNodeServer) NodeGetInfo

func (*LinodeNodeServer) NodeGetVolumeStats

func (*LinodeNodeServer) NodePublishVolume

func (*LinodeNodeServer) NodeStageVolume

func (*LinodeNodeServer) NodeUnpublishVolume

func (*LinodeNodeServer) NodeUnstageVolume

type LuksContext

type LuksContext struct {
	EncryptionEnabled bool
	EncryptionKey     string
	EncryptionCipher  string
	EncryptionKeySize string
	VolumeName        string
	VolumeLifecycle   VolumeLifecycle
}

type Metadata

type Metadata struct {
	ID     int    // Instance ID.
	Label  string // The label assigned to the instance.
	Region string // Region the instance is running in.
	Memory uint   // Amount of memory the instance has, in bytes.
}

Metadata contains metadata about the node/instance the CSI node plugin is running on.

func GetMetadata

func GetMetadata(ctx context.Context) (Metadata, error)

GetMetadata retrieves information about the current node/instance from the Linode Metadata Service. If the Metadata Service is unavailable, or this function otherwise returns a non-nil error, callers should call GetMetadataFromAPI.

func GetMetadataFromAPI

func GetMetadataFromAPI(ctx context.Context, client *linodego.Client) (Metadata, error)

GetMetadataFromAPI attempts to retrieve metadata about the current node/instance directly from the Linode API.

type NonBlockingGRPCServer

type NonBlockingGRPCServer interface {
	// Start services at the endpoint
	Start(endpoint string, ids csi.IdentityServer, cs csi.ControllerServer, ns csi.NodeServer)
	// Waits for the service to stop
	Wait()
	// Stops the service gracefully
	Stop()
	// Stops the service forcefully
	ForceStop()
}

Defines Non blocking GRPC server interfaces

func NewNonBlockingGRPCServer

func NewNonBlockingGRPCServer() NonBlockingGRPCServer

type VolumeLifecycle

type VolumeLifecycle string

Jump to

Keyboard shortcuts

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