driver

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	VolumeTypeKey     = "type"
	AccountingTypeKey = "accountingtype"
)

constants of keys in volume parameters

View Source
const (
	// DriverName is name for this CSI
	DriverName = "additional-storage.csi.nifcloud.com"
	// TopologyKey is key
	TopologyKey = "topology." + DriverName + "/zone"
)
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 (
	DefaultCSIEndpoint = "unix://tmp/csi.sock"
)

constants for default command line flag values

View Source
const (
	DevicePathKey = "devicePath"
)

constants of keys in PublishContext

Variables

View Source
var (
	// ValidFSTypes is valid filesystem type.
	ValidFSTypes = []string{FSTypeExt2, FSTypeExt3, FSTypeExt4, FSTypeXfs}
)

Functions

func GetVersionJSON

func GetVersionJSON() (string, error)

GetVersionJSON returns the version info json

func WithEndpoint

func WithEndpoint(endpoint string) func(*DriverOptions)

WithEndpoint sets the endpoint

func WithNifcloudSdkDebugLog added in v1.0.0

func WithNifcloudSdkDebugLog(nifcloudSdkDebugLog bool) func(*DriverOptions)

WithNifcloudSdkDebugLog sets the nifcloud sdk debug log

Types

type Driver

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

Driver is CSI driver object

func NewDriver

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

NewDriver creates the new CSI driver

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) 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 (n *Driver) NodeExpandVolume(ctx context.Context, req *csi.NodeExpandVolumeRequest) (*csi.NodeExpandVolumeResponse, error)

func (*Driver) NodeGetCapabilities

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

func (*Driver) NodeGetInfo

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

func (*Driver) NodeGetVolumeStats

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

func (*Driver) NodePublishVolume

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

func (*Driver) NodeStageVolume

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

func (*Driver) NodeUnpublishVolume

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

func (*Driver) NodeUnstageVolume

func (n *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

Run runs the gRPC server

func (*Driver) Stop

func (d *Driver) Stop()

Stop stops the server

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
}

DriverOptions is option for CSI driver.

type Mounter

type Mounter interface {
	mount.Interface
	exec.Interface
	FormatAndMount(source string, target string, fstype string, options []string) error
	GetDeviceName(mountPath string) (string, int, error)
	MakeFile(pathname string) error
	MakeDir(pathname string) error
	ExistsPath(filename string) (bool, error)
}

Mounter is an interface for mount operations

type NodeMounter

type NodeMounter struct {
	mount.SafeFormatAndMount
	exec.Interface
}

NodeMounter mount the devices.

func (*NodeMounter) ExistsPath

func (m *NodeMounter) ExistsPath(filename string) (bool, error)

func (*NodeMounter) GetDeviceName

func (m *NodeMounter) GetDeviceName(mountPath string) (string, int, error)

GetDeviceName returns the device name from path

func (*NodeMounter) MakeDir

func (m *NodeMounter) MakeDir(pathname string) error

func (*NodeMounter) MakeFile

func (m *NodeMounter) MakeFile(pathname string) error

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"`
}

VersionInfo is version information of this driver.

func GetVersion

func GetVersion() VersionInfo

GetVersion returns the version info

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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