driver

package
v0.0.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// VolumeTypeKey represents key for volume type
	VolumeTypeKey = "type"

	// PVCNameKey contains name of the PVC for which is a volume provisioned.
	PVCNameKey = "csi.storage.k8s.io/pvc/name"

	// PVCNamespaceKey contains namespace of the PVC for which is a volume provisioned.
	PVCNamespaceKey = "csi.storage.k8s.io/pvc/namespace"

	// PVNameKey contains name of the final PV that will be used for the dynamically
	// provisioned volume
	PVNameKey = "csi.storage.k8s.io/pv/name"
)

constants of keys in volume parameters

View Source
const (
	DefaultCSIEndpoint = "unix://tmp/csi.sock"
	DefaultStatehubAPI = "https://api.statehub.io"
)

constants for default command line flag values

View Source
const (
	StatehubTopologyPrefix             = "topology.statehub.csi"
	StatehubProviderTopologyLabel      = "topology.statehub.csi/provider"
	StatehubProviderScopeTopologyLabel = "topology.statehub.csi/providerScope"
	StatehubRegionTopologyLabel        = "topology.statehub.csi/region"
	StatehubVnetTopologyLabel          = "topology.statehub.csi/vnet"
	StatehubSubnetTopologyLabel        = "topology.statehub.csi/subnet"
	StatehubStatusTopologyLabel        = "topology.statehub.csi/status"
)

constants for statehub topology labels

View Source
const (
	DriverName = "csi.statehub.io"

	WellKnownTopologyKey = "topology.kubernetes.io/zone"
	// DEPRECATED Use the WellKnownTopologyKey instead
	TopologyKey    = "topology." + DriverName + "/zone"
	TopologyPrefix = "topology." + DriverName
)
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"

	// VolumeOperationAlreadyExists is message fmt returned to CO when there is another in-flight call on the given volumeID
	VolumeOperationAlreadyExists = "An operation with the given volume=%q is already in progress"
)
View Source
const (
	// devicePathKey represents key for device path in PublishContext
	// devicePath is the device path where the volume is attached to
	DevicePathKey = "devicePath"
)

constants of keys in PublishContext

View Source
const (
	// VolumeAttributePartition represents key for partition config in VolumeContext
	// this represents the partition number on a device used to mount
	VolumeAttributePartition = "partition"
)

constants of keys in VolumeContext

Variables

View Source
var (
	// NewMetadataFunc is a variable for the cloud.NewMetadata function that can
	// be overwritten in unit tests.
	NewMetadataFunc = statehub.NewMetadata
	// NewCloudFunc is a variable for the cloud.NewCloud function that can
	// be overwritten in unit tests.
	NewCloudFunc = statehub.NewStatehub
)

Functions

func GetVersionJSON

func GetVersionJSON() (string, error)

func ValidateDriverOptions

func ValidateDriverOptions(options *DriverOptions) error

func WithEndpoint

func WithEndpoint(endpoint string) func(*DriverOptions)

func WithExtraTags

func WithExtraTags(extraTags map[string]string) func(*DriverOptions)

func WithExtraVolumeTags

func WithExtraVolumeTags(extraVolumeTags map[string]string) func(*DriverOptions)

func WithKubernetesClusterID

func WithKubernetesClusterID(clusterID string) func(*DriverOptions)

func WithMode

func WithMode(mode Mode) func(*DriverOptions)

func WithStatehubAPI

func WithStatehubAPI(statehubapi string) func(*DriverOptions)

func WithVolumeAttachLimit

func WithVolumeAttachLimit(volumeAttachLimit int64) func(*DriverOptions)

Types

type Driver

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

func NewDriver

func NewDriver(options ...func(*DriverOptions)) (*Driver, error)

func (*Driver) ControllerExpandVolume

func (d *Driver) ControllerExpandVolume(ctx context.Context, req *csi.ControllerExpandVolumeRequest) (*csi.ControllerExpandVolumeResponse, error)

func (*Driver) ControllerGetCapabilities

func (d *Driver) ControllerGetCapabilities(ctx context.Context, req *csi.ControllerGetCapabilitiesRequest) (*csi.ControllerGetCapabilitiesResponse, error)

func (*Driver) ControllerGetVolume

func (d *Driver) ControllerGetVolume(ctx context.Context, req *csi.ControllerGetVolumeRequest) (*csi.ControllerGetVolumeResponse, error)

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)

func (*Driver) GetCapacity

func (d *Driver) GetCapacity(ctx context.Context, req *csi.GetCapacityRequest) (*csi.GetCapacityResponse, error)

func (*Driver) GetPluginInfo

func (d *Driver) GetPluginInfo(ctx context.Context, req *csi.GetPluginInfoRequest) (*csi.GetPluginInfoResponse, error)

func (*Driver) IsBlockDevice

func (d *Driver) IsBlockDevice(fullPath string) (bool, error)

IsBlock checks if the given path is a block device

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)

func (*Driver) NodeExpandVolume

func (d *Driver) NodeExpandVolume(ctx context.Context, req *csi.NodeExpandVolumeRequest) (*csi.NodeExpandVolumeResponse, error)

func (*Driver) NodeGetCapabilities

func (d *Driver) NodeGetCapabilities(ctx context.Context, req *csi.NodeGetCapabilitiesRequest) (*csi.NodeGetCapabilitiesResponse, error)

func (*Driver) NodeGetInfo

func (d *Driver) NodeGetInfo(ctx context.Context, req *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error)

func (*Driver) NodeGetVolumeStats

func (d *Driver) NodeGetVolumeStats(ctx context.Context, req *csi.NodeGetVolumeStatsRequest) (*csi.NodeGetVolumeStatsResponse, error)

func (*Driver) NodePublishVolume

func (d *Driver) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error)

func (*Driver) NodeStageVolume

func (d *Driver) NodeStageVolume(ctx context.Context, req *csi.NodeStageVolumeRequest) (*csi.NodeStageVolumeResponse, error)

func (*Driver) NodeUnpublishVolume

func (d *Driver) NodeUnpublishVolume(ctx context.Context, req *csi.NodeUnpublishVolumeRequest) (*csi.NodeUnpublishVolumeResponse, error)

func (*Driver) NodeUnstageVolume

func (d *Driver) NodeUnstageVolume(ctx context.Context, req *csi.NodeUnstageVolumeRequest) (*csi.NodeUnstageVolumeResponse, error)

func (*Driver) Probe

func (d *Driver) Probe(ctx context.Context, req *csi.ProbeRequest) (*csi.ProbeResponse, error)

func (*Driver) Run

func (d *Driver) Run() error

func (*Driver) Stop

func (d *Driver) Stop()

func (*Driver) ValidateVolumeCapabilities

func (d *Driver) ValidateVolumeCapabilities(ctx context.Context, req *csi.ValidateVolumeCapabilitiesRequest) (*csi.ValidateVolumeCapabilitiesResponse, error)

type DriverOptions

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

type Mode

type Mode string

Mode is the operating mode of the CSI driver.

const (
	// ControllerMode is the mode that only starts the controller service.
	ControllerMode Mode = "controller"
	// NodeMode is the mode that only starts the node service.
	NodeMode Mode = "node"
	// AllMode is the mode that only starts both the controller and the node service.
	AllMode Mode = "all"
)

type VersionInfo

type VersionInfo struct {
	DriverVersion string `json:"driverVersion"`
	GitCommit     string `json:"gitCommit"`
	BuildDate     string `json:"buildDate"`
	GoVersion     string `json:"goVersion"`
	Compiler      string `json:"compiler"`
	Platform      string `json:"platform"`
}

func GetVersion

func GetVersion() VersionInfo

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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