Documentation ¶
Index ¶
- Constants
- func GetVersionYAML(driverName string) (string, error)
- func IsCorruptedDir(dir string) bool
- func NewControllerServiceCapability(cap csi.ControllerServiceCapability_RPC_Type) *csi.ControllerServiceCapability
- func NewFakeMounter() (*mount.SafeFormatAndMount, error)
- func NewNodeServiceCapability(cap csi.NodeServiceCapability_RPC_Type) *csi.NodeServiceCapability
- func ParseEndpoint(ep string) (string, string, error)
- func TarPack(srcDirPath string, dstPath string, enableCompression bool) error
- func TarUnpack(srcPath, dstDirPath string, enableCompression bool) (err error)
- func WaitUntilTimeout(timeout time.Duration, execFunc ExecFunc, timeoutFunc TimeoutFunc) error
- type ControllerServer
- func (cs *ControllerServer) ControllerExpandVolume(_ context.Context, req *csi.ControllerExpandVolumeRequest) (*csi.ControllerExpandVolumeResponse, error)
- func (cs *ControllerServer) ControllerGetCapabilities(_ context.Context, _ *csi.ControllerGetCapabilitiesRequest) (*csi.ControllerGetCapabilitiesResponse, error)
- func (cs *ControllerServer) ControllerGetVolume(_ context.Context, _ *csi.ControllerGetVolumeRequest) (*csi.ControllerGetVolumeResponse, error)
- func (cs *ControllerServer) ControllerPublishVolume(_ context.Context, _ *csi.ControllerPublishVolumeRequest) (*csi.ControllerPublishVolumeResponse, error)
- func (cs *ControllerServer) ControllerUnpublishVolume(_ context.Context, _ *csi.ControllerUnpublishVolumeRequest) (*csi.ControllerUnpublishVolumeResponse, error)
- func (cs *ControllerServer) CreateSnapshot(ctx context.Context, req *csi.CreateSnapshotRequest) (*csi.CreateSnapshotResponse, error)
- func (cs *ControllerServer) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest) (*csi.CreateVolumeResponse, error)
- func (cs *ControllerServer) DeleteSnapshot(ctx context.Context, req *csi.DeleteSnapshotRequest) (*csi.DeleteSnapshotResponse, error)
- func (cs *ControllerServer) DeleteVolume(ctx context.Context, req *csi.DeleteVolumeRequest) (*csi.DeleteVolumeResponse, error)
- func (cs *ControllerServer) GetCapacity(_ context.Context, _ *csi.GetCapacityRequest) (*csi.GetCapacityResponse, error)
- func (cs *ControllerServer) ListSnapshots(_ context.Context, _ *csi.ListSnapshotsRequest) (*csi.ListSnapshotsResponse, error)
- func (cs *ControllerServer) ListVolumes(_ context.Context, _ *csi.ListVolumesRequest) (*csi.ListVolumesResponse, error)
- func (cs *ControllerServer) ValidateVolumeCapabilities(_ context.Context, req *csi.ValidateVolumeCapabilitiesRequest) (*csi.ValidateVolumeCapabilitiesResponse, error)
- type Driver
- func (n *Driver) AddControllerServiceCapabilities(cl []csi.ControllerServiceCapability_RPC_Type)
- func (n *Driver) AddNodeServiceCapabilities(nl []csi.NodeServiceCapability_RPC_Type)
- func (d *Driver) ControllerModifyVolume(_ context.Context, _ *csi.ControllerModifyVolumeRequest) (*csi.ControllerModifyVolumeResponse, error)
- func (n *Driver) Run(testMode bool)
- type DriverOptions
- type ExecFunc
- type IdentityServer
- func (ids *IdentityServer) GetPluginCapabilities(_ context.Context, _ *csi.GetPluginCapabilitiesRequest) (*csi.GetPluginCapabilitiesResponse, error)
- func (ids *IdentityServer) GetPluginInfo(_ context.Context, _ *csi.GetPluginInfoRequest) (*csi.GetPluginInfoResponse, error)
- func (ids *IdentityServer) Probe(_ context.Context, _ *csi.ProbeRequest) (*csi.ProbeResponse, error)
- type NodeServer
- func (ns *NodeServer) NodeExpandVolume(_ context.Context, _ *csi.NodeExpandVolumeRequest) (*csi.NodeExpandVolumeResponse, error)
- func (ns *NodeServer) NodeGetCapabilities(_ context.Context, _ *csi.NodeGetCapabilitiesRequest) (*csi.NodeGetCapabilitiesResponse, error)
- func (ns *NodeServer) NodeGetInfo(_ context.Context, _ *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error)
- func (ns *NodeServer) NodeGetVolumeStats(_ context.Context, req *csi.NodeGetVolumeStatsRequest) (*csi.NodeGetVolumeStatsResponse, error)
- func (ns *NodeServer) NodePublishVolume(_ context.Context, req *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error)
- func (ns *NodeServer) NodeStageVolume(_ context.Context, _ *csi.NodeStageVolumeRequest) (*csi.NodeStageVolumeResponse, error)
- func (ns *NodeServer) NodeUnpublishVolume(_ context.Context, req *csi.NodeUnpublishVolumeRequest) (*csi.NodeUnpublishVolumeResponse, error)
- func (ns *NodeServer) NodeUnstageVolume(_ context.Context, _ *csi.NodeUnstageVolumeRequest) (*csi.NodeUnstageVolumeResponse, error)
- type NonBlockingGRPCServer
- type TimeoutFunc
- type VersionInfo
- type VolumeLocks
Constants ¶
const (
DefaultDriverName = "nfs.csi.k8s.io"
)
Variables ¶
This section is empty.
Functions ¶
func GetVersionYAML ¶
GetVersionYAML returns the version information of the driver in YAML format
func IsCorruptedDir ¶
func NewControllerServiceCapability ¶
func NewControllerServiceCapability(cap csi.ControllerServiceCapability_RPC_Type) *csi.ControllerServiceCapability
func NewFakeMounter ¶
func NewFakeMounter() (*mount.SafeFormatAndMount, error)
func NewNodeServiceCapability ¶
func NewNodeServiceCapability(cap csi.NodeServiceCapability_RPC_Type) *csi.NodeServiceCapability
func WaitUntilTimeout ¶
func WaitUntilTimeout(timeout time.Duration, execFunc ExecFunc, timeoutFunc TimeoutFunc) error
WaitUntilTimeout waits for the exec function to complete or return timeout error
Types ¶
type ControllerServer ¶
type ControllerServer struct { Driver *Driver csi.UnimplementedControllerServer }
ControllerServer controller server setting
func NewControllerServer ¶
func NewControllerServer(d *Driver) *ControllerServer
func (*ControllerServer) ControllerExpandVolume ¶
func (cs *ControllerServer) ControllerExpandVolume(_ context.Context, req *csi.ControllerExpandVolumeRequest) (*csi.ControllerExpandVolumeResponse, error)
func (*ControllerServer) ControllerGetCapabilities ¶
func (cs *ControllerServer) ControllerGetCapabilities(_ context.Context, _ *csi.ControllerGetCapabilitiesRequest) (*csi.ControllerGetCapabilitiesResponse, error)
ControllerGetCapabilities implements the default GRPC callout. Default supports all capabilities
func (*ControllerServer) ControllerGetVolume ¶
func (cs *ControllerServer) ControllerGetVolume(_ context.Context, _ *csi.ControllerGetVolumeRequest) (*csi.ControllerGetVolumeResponse, error)
func (*ControllerServer) ControllerPublishVolume ¶
func (cs *ControllerServer) ControllerPublishVolume(_ context.Context, _ *csi.ControllerPublishVolumeRequest) (*csi.ControllerPublishVolumeResponse, error)
func (*ControllerServer) ControllerUnpublishVolume ¶
func (cs *ControllerServer) ControllerUnpublishVolume(_ context.Context, _ *csi.ControllerUnpublishVolumeRequest) (*csi.ControllerUnpublishVolumeResponse, error)
func (*ControllerServer) CreateSnapshot ¶
func (cs *ControllerServer) CreateSnapshot(ctx context.Context, req *csi.CreateSnapshotRequest) (*csi.CreateSnapshotResponse, error)
func (*ControllerServer) CreateVolume ¶
func (cs *ControllerServer) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest) (*csi.CreateVolumeResponse, error)
CreateVolume create a volume
func (*ControllerServer) DeleteSnapshot ¶
func (cs *ControllerServer) DeleteSnapshot(ctx context.Context, req *csi.DeleteSnapshotRequest) (*csi.DeleteSnapshotResponse, error)
func (*ControllerServer) DeleteVolume ¶
func (cs *ControllerServer) DeleteVolume(ctx context.Context, req *csi.DeleteVolumeRequest) (*csi.DeleteVolumeResponse, error)
DeleteVolume delete a volume
func (*ControllerServer) GetCapacity ¶
func (cs *ControllerServer) GetCapacity(_ context.Context, _ *csi.GetCapacityRequest) (*csi.GetCapacityResponse, error)
func (*ControllerServer) ListSnapshots ¶
func (cs *ControllerServer) ListSnapshots(_ context.Context, _ *csi.ListSnapshotsRequest) (*csi.ListSnapshotsResponse, error)
func (*ControllerServer) ListVolumes ¶
func (cs *ControllerServer) ListVolumes(_ context.Context, _ *csi.ListVolumesRequest) (*csi.ListVolumesResponse, error)
func (*ControllerServer) ValidateVolumeCapabilities ¶
func (cs *ControllerServer) ValidateVolumeCapabilities(_ context.Context, req *csi.ValidateVolumeCapabilitiesRequest) (*csi.ValidateVolumeCapabilitiesResponse, error)
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
func NewDriver ¶
func NewDriver(options *DriverOptions) *Driver
func (*Driver) AddControllerServiceCapabilities ¶
func (n *Driver) AddControllerServiceCapabilities(cl []csi.ControllerServiceCapability_RPC_Type)
func (*Driver) AddNodeServiceCapabilities ¶
func (n *Driver) AddNodeServiceCapabilities(nl []csi.NodeServiceCapability_RPC_Type)
func (*Driver) ControllerModifyVolume ¶
func (d *Driver) ControllerModifyVolume(_ context.Context, _ *csi.ControllerModifyVolumeRequest) (*csi.ControllerModifyVolumeResponse, error)
type DriverOptions ¶
type DriverOptions struct { NodeID string DriverName string Endpoint string MountPermissions uint64 WorkingMountDir string DefaultOnDeletePolicy string VolStatsCacheExpireInMinutes int RemoveArchivedVolumePath bool UseTarCommandInSnapshot bool }
DriverOptions defines driver parameters specified in driver deployment
type ExecFunc ¶
type ExecFunc func() (err error)
ExecFunc returns a exec function's output and error
type IdentityServer ¶
type IdentityServer struct { Driver *Driver csi.UnimplementedIdentityServer }
func NewDefaultIdentityServer ¶
func NewDefaultIdentityServer(d *Driver) *IdentityServer
func (*IdentityServer) GetPluginCapabilities ¶
func (ids *IdentityServer) GetPluginCapabilities(_ context.Context, _ *csi.GetPluginCapabilitiesRequest) (*csi.GetPluginCapabilitiesResponse, error)
func (*IdentityServer) GetPluginInfo ¶
func (ids *IdentityServer) GetPluginInfo(_ context.Context, _ *csi.GetPluginInfoRequest) (*csi.GetPluginInfoResponse, error)
func (*IdentityServer) Probe ¶
func (ids *IdentityServer) Probe(_ context.Context, _ *csi.ProbeRequest) (*csi.ProbeResponse, error)
Probe check whether the plugin is running or not. This method does not need to return anything. Currently the spec does not dictate what you should return either. Hence, return an empty response
type NodeServer ¶
type NodeServer struct { Driver *Driver csi.UnimplementedNodeServer // contains filtered or unexported fields }
NodeServer driver
func NewNodeServer ¶
func NewNodeServer(n *Driver, mounter mount.Interface) *NodeServer
func (*NodeServer) NodeExpandVolume ¶
func (ns *NodeServer) NodeExpandVolume(_ context.Context, _ *csi.NodeExpandVolumeRequest) (*csi.NodeExpandVolumeResponse, error)
NodeExpandVolume node expand volume
func (*NodeServer) NodeGetCapabilities ¶
func (ns *NodeServer) NodeGetCapabilities(_ context.Context, _ *csi.NodeGetCapabilitiesRequest) (*csi.NodeGetCapabilitiesResponse, error)
NodeGetCapabilities return the capabilities of the Node plugin
func (*NodeServer) NodeGetInfo ¶
func (ns *NodeServer) NodeGetInfo(_ context.Context, _ *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error)
NodeGetInfo return info of the node on which this plugin is running
func (*NodeServer) NodeGetVolumeStats ¶
func (ns *NodeServer) NodeGetVolumeStats(_ context.Context, req *csi.NodeGetVolumeStatsRequest) (*csi.NodeGetVolumeStatsResponse, error)
NodeGetVolumeStats get volume stats
func (*NodeServer) NodePublishVolume ¶
func (ns *NodeServer) NodePublishVolume(_ context.Context, req *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error)
NodePublishVolume mount the volume
func (*NodeServer) NodeStageVolume ¶
func (ns *NodeServer) NodeStageVolume(_ context.Context, _ *csi.NodeStageVolumeRequest) (*csi.NodeStageVolumeResponse, error)
NodeStageVolume stage volume
func (*NodeServer) NodeUnpublishVolume ¶
func (ns *NodeServer) NodeUnpublishVolume(_ context.Context, req *csi.NodeUnpublishVolumeRequest) (*csi.NodeUnpublishVolumeResponse, error)
NodeUnpublishVolume unmount the volume
func (*NodeServer) NodeUnstageVolume ¶
func (ns *NodeServer) NodeUnstageVolume(_ context.Context, _ *csi.NodeUnstageVolumeRequest) (*csi.NodeUnstageVolumeResponse, error)
NodeUnstageVolume unstage volume
type NonBlockingGRPCServer ¶
type NonBlockingGRPCServer interface { // Start services at the endpoint Start(endpoint string, ids csi.IdentityServer, cs csi.ControllerServer, ns csi.NodeServer, testMode bool) // 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 TimeoutFunc ¶
type TimeoutFunc func() (err error)
TimeoutFunc returns output and error if an ExecFunc timeout
type VersionInfo ¶
type VersionInfo struct { DriverName string `json:"Driver Name"` DriverVersion string `json:"Driver Version"` GitCommit string `json:"Git Commit"` BuildDate string `json:"Build Date"` GoVersion string `json:"Go Version"` Compiler string `json:"Compiler"` Platform string `json:"Platform"` }
VersionInfo holds the version information of the driver
func GetVersion ¶
func GetVersion(driverName string) VersionInfo
GetVersion returns the version information of the driver
type VolumeLocks ¶
type VolumeLocks struct {
// contains filtered or unexported fields
}
func NewVolumeLocks ¶
func NewVolumeLocks() *VolumeLocks
func (*VolumeLocks) Release ¶
func (vl *VolumeLocks) Release(volumeID string)
func (*VolumeLocks) TryAcquire ¶
func (vl *VolumeLocks) TryAcquire(volumeID string) bool