Documentation ¶
Index ¶
- Constants
- func IsCorruptDir(dir string) bool
- func NewControllerServiceCapability(cap csi.ControllerServiceCapability_RPC_Type) *csi.ControllerServiceCapability
- type ControllerServer
- func (c *ControllerServer) ControllerExpandVolume(context.Context, *csi.ControllerExpandVolumeRequest) (*csi.ControllerExpandVolumeResponse, error)
- func (c *ControllerServer) ControllerGetCapabilities(context.Context, *csi.ControllerGetCapabilitiesRequest) (*csi.ControllerGetCapabilitiesResponse, error)
- func (c *ControllerServer) ControllerGetVolume(context.Context, *csi.ControllerGetVolumeRequest) (*csi.ControllerGetVolumeResponse, error)
- func (c *ControllerServer) ControllerModifyVolume(context.Context, *csi.ControllerModifyVolumeRequest) (*csi.ControllerModifyVolumeResponse, error)
- func (c *ControllerServer) ControllerPublishVolume(context.Context, *csi.ControllerPublishVolumeRequest) (*csi.ControllerPublishVolumeResponse, error)
- func (c *ControllerServer) ControllerUnpublishVolume(context.Context, *csi.ControllerUnpublishVolumeRequest) (*csi.ControllerUnpublishVolumeResponse, error)
- func (c *ControllerServer) CreateSnapshot(context.Context, *csi.CreateSnapshotRequest) (*csi.CreateSnapshotResponse, error)
- func (c *ControllerServer) CreateVolume(_ context.Context, req *csi.CreateVolumeRequest) (*csi.CreateVolumeResponse, error)
- func (c *ControllerServer) DeleteSnapshot(context.Context, *csi.DeleteSnapshotRequest) (*csi.DeleteSnapshotResponse, error)
- func (c *ControllerServer) DeleteVolume(_ context.Context, req *csi.DeleteVolumeRequest) (*csi.DeleteVolumeResponse, error)
- func (c *ControllerServer) GetCapacity(context.Context, *csi.GetCapacityRequest) (*csi.GetCapacityResponse, error)
- func (c *ControllerServer) ListSnapshots(context.Context, *csi.ListSnapshotsRequest) (*csi.ListSnapshotsResponse, error)
- func (c *ControllerServer) ListVolumes(context.Context, *csi.ListVolumesRequest) (*csi.ListVolumesResponse, error)
- func (c *ControllerServer) ValidateVolumeCapabilities(_ context.Context, req *csi.ValidateVolumeCapabilitiesRequest) (*csi.ValidateVolumeCapabilitiesResponse, error)
- type Driver
- type DriverOptions
- type IdentityServer
- type NodeServer
- func (n *NodeServer) NodeExpandVolume(_ context.Context, _ *csi.NodeExpandVolumeRequest) (*csi.NodeExpandVolumeResponse, error)
- func (n *NodeServer) NodeGetCapabilities(_ context.Context, _ *csi.NodeGetCapabilitiesRequest) (*csi.NodeGetCapabilitiesResponse, error)
- func (n *NodeServer) NodeGetInfo(_ context.Context, _ *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error)
- func (n *NodeServer) NodeGetVolumeStats(_ context.Context, req *csi.NodeGetVolumeStatsRequest) (*csi.NodeGetVolumeStatsResponse, error)
- func (n *NodeServer) NodePublishVolume(_ context.Context, req *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error)
- func (n *NodeServer) NodeStageVolume(_ context.Context, _ *csi.NodeStageVolumeRequest) (*csi.NodeStageVolumeResponse, error)
- func (n *NodeServer) NodeUnpublishVolume(_ context.Context, req *csi.NodeUnpublishVolumeRequest) (*csi.NodeUnpublishVolumeResponse, error)
- func (n *NodeServer) NodeUnstageVolume(_ context.Context, _ *csi.NodeUnstageVolumeRequest) (*csi.NodeUnstageVolumeResponse, error)
- type NonBlockingGRPCServer
- type NonBlockingGRPCServerOptions
Constants ¶
const ( // DefaultDriverName is the default name of the driver. DefaultDriverName = "s3.csi.k8s.io" // ParamServer is the address of the minio server. ParamServer = "server" ParamShare = "share" // ParamSubDir is the subdirectory under the base directory to create volumes under. ParamSubDir = "subdir" // ParamOnDelete is the policy for handling volumes on delete. ParamOnDelete = "ondelete" // MountOptionsField is the field name for mount options. MountOptionsField = "mountoptions" // MountPermissionsField is the field name for mount permissions. MountPermissionsField = "mountpermissions" // PvcNameKey is the key for PVC name. PvcNameKey = "csi.storage.k8s.io/pvc/name" // PvcNamespaceKey is the key for PVC namespace. PvcNamespaceKey = "csi.storage.k8s.io/pvc/namespace" // PvNameKey is the key for PV name. PvNameKey = "csi.storage.k8s.io/pv/name" // PvcNameMetadata is the metadata for PVC name. PvcNameMetadata = "${pvc.metadata.name}" // PvcNamespaceMetadata is the metadata for PVC namespace. PvcNamespaceMetadata = "${pvc.metadata.namespace}" // PvNameMetadata is the metadata for PV name. PvNameMetadata = "${pv.metadata.name}" )
Variables ¶
This section is empty.
Functions ¶
func IsCorruptDir ¶
IsCorruptDir checks if the directory is corrupt. 检查目录是否损坏
func NewControllerServiceCapability ¶
func NewControllerServiceCapability(cap csi.ControllerServiceCapability_RPC_Type) *csi.ControllerServiceCapability
NewControllerServiceCapability creates a new ControllerServiceCapability
Types ¶
type ControllerServer ¶
type ControllerServer struct {
*common.DefaultControllerServer
}
func NewControllerServer ¶
func NewControllerServer(d *common.CSIDriver) *ControllerServer
NewControllerServer creates a new controller server.
func (*ControllerServer) ControllerExpandVolume ¶
func (c *ControllerServer) ControllerExpandVolume(context.Context, *csi.ControllerExpandVolumeRequest) (*csi.ControllerExpandVolumeResponse, error)
ControllerExpandVolume implements csi.ControllerServer.
func (*ControllerServer) ControllerGetCapabilities ¶
func (c *ControllerServer) ControllerGetCapabilities(context.Context, *csi.ControllerGetCapabilitiesRequest) (*csi.ControllerGetCapabilitiesResponse, error)
ControllerGetCapabilities implements csi.ControllerServer.
func (*ControllerServer) ControllerGetVolume ¶
func (c *ControllerServer) ControllerGetVolume(context.Context, *csi.ControllerGetVolumeRequest) (*csi.ControllerGetVolumeResponse, error)
ControllerGetVolume implements csi.ControllerServer.
func (*ControllerServer) ControllerModifyVolume ¶
func (c *ControllerServer) ControllerModifyVolume(context.Context, *csi.ControllerModifyVolumeRequest) (*csi.ControllerModifyVolumeResponse, error)
ControllerModifyVolume implements csi.ControllerServer.
func (*ControllerServer) ControllerPublishVolume ¶
func (c *ControllerServer) ControllerPublishVolume(context.Context, *csi.ControllerPublishVolumeRequest) (*csi.ControllerPublishVolumeResponse, error)
ControllerPublishVolume implements csi.ControllerServer.
func (*ControllerServer) ControllerUnpublishVolume ¶
func (c *ControllerServer) ControllerUnpublishVolume(context.Context, *csi.ControllerUnpublishVolumeRequest) (*csi.ControllerUnpublishVolumeResponse, error)
ControllerUnpublishVolume implements csi.ControllerServer.
func (*ControllerServer) CreateSnapshot ¶
func (c *ControllerServer) CreateSnapshot(context.Context, *csi.CreateSnapshotRequest) (*csi.CreateSnapshotResponse, error)
CreateSnapshot implements csi.ControllerServer.
func (*ControllerServer) CreateVolume ¶
func (c *ControllerServer) CreateVolume(_ context.Context, req *csi.CreateVolumeRequest) (*csi.CreateVolumeResponse, error)
CreateVolume implements csi.ControllerServer.
func (*ControllerServer) DeleteSnapshot ¶
func (c *ControllerServer) DeleteSnapshot(context.Context, *csi.DeleteSnapshotRequest) (*csi.DeleteSnapshotResponse, error)
DeleteSnapshot implements csi.ControllerServer.
func (*ControllerServer) DeleteVolume ¶
func (c *ControllerServer) DeleteVolume(_ context.Context, req *csi.DeleteVolumeRequest) (*csi.DeleteVolumeResponse, error)
DeleteVolume implements csi.ControllerServer.
func (*ControllerServer) GetCapacity ¶
func (c *ControllerServer) GetCapacity(context.Context, *csi.GetCapacityRequest) (*csi.GetCapacityResponse, error)
GetCapacity implements csi.ControllerServer.
func (*ControllerServer) ListSnapshots ¶
func (c *ControllerServer) ListSnapshots(context.Context, *csi.ListSnapshotsRequest) (*csi.ListSnapshotsResponse, error)
ListSnapshots implements csi.ControllerServer.
func (*ControllerServer) ListVolumes ¶
func (c *ControllerServer) ListVolumes(context.Context, *csi.ListVolumesRequest) (*csi.ListVolumesResponse, error)
ListVolumes implements csi.ControllerServer.
func (*ControllerServer) ValidateVolumeCapabilities ¶
func (c *ControllerServer) ValidateVolumeCapabilities(_ context.Context, req *csi.ValidateVolumeCapabilitiesRequest) (*csi.ValidateVolumeCapabilitiesResponse, error)
ValidateVolumeCapabilities implements csi.ControllerServer.
type Driver ¶
type Driver struct { Name string // Name is the name of the driver. NodeID string // NodeID is the ID of the node where the driver is running. Version string // Version is the version of the driver. EndPoint string // EndPoint is the endpoint of the driver. MountPermissions uint64 // MountPermissions is the mount permissions for the driver. WorkingMountDir string // WorkingMountDir is the working directory for mount operations. DefaultOnDeletePolicy string // DefaultOnDeletePolicy is the default policy for handling volumes on delete. NodeServer *NodeServer // NodeServer is the server for handling node service requests. ControllerServer *ControllerServer // ControllerServer is the server for handling controller service requests. IdentityServer *IdentityServer // IdentityServer is the server for handling identity service requests. Driver *common.CSIDriver // Driver is the CSI driver. ControllerServiceCapability []*csi.ControllerServiceCapability // ControllerServiceCapability represents the capabilities of the controller service. NodeServiceCapability []*csi.NodeServiceCapability // NodeServiceCapability represents the capabilities of the node service. VolumeLocks *utils.VolumeLocks // VolumeLocks is used for locking volumes during operations. VolumeStatsCache cache.Resource // VolumeStatsCache is the cache for volume statistics. VolumeStatsCacheExpireInMinutes int // VolumeStatsCacheExpireInMinutes is the expiration time for volume statistics cache. }
Driver represents the CSI driver.
func NewDriver ¶
func NewDriver(options *DriverOptions) (*Driver, error)
NewDriver creates a new driver object.
func (*Driver) AddControllerServiceCapabilities ¶
func (d *Driver) AddControllerServiceCapabilities(cl []csi.ControllerServiceCapability_RPC_Type)
AddControllerServiceCapabilities adds the given controller service capabilities to the driver.
type DriverOptions ¶
type DriverOptions struct { DriverName string // DriverName is the name of the CSI driver. NodeID string // NodeID is the unique identifier of the node where the driver is running. EndPoint string // EndPoint is the CSI endpoint address. MountPermissions uint64 // MountPermissions is the permission mode for mounting volumes. WorkingMountDir string // WorkingMountDir is the directory where volumes are mounted. VolumeStatsCacheExpireInMinutes int // VolumeStatsCacheExpireInMinutes is the expiration time for volume statistics cache in minutes. }
DriverOptions represents the options for creating a new driver.
type IdentityServer ¶
type IdentityServer struct {
*common.DefaultIdentityServer
}
func NewIdentityServer ¶
func NewIdentityServer(d *common.CSIDriver) *IdentityServer
NewIdentityServer creates a new identity server.
func (*IdentityServer) GetPluginCapabilities ¶
func (i *IdentityServer) GetPluginCapabilities(_ context.Context, _ *csi.GetPluginCapabilitiesRequest) (*csi.GetPluginCapabilitiesResponse, error)
GetPluginCapabilities returns the capabilities of the plugin.
func (*IdentityServer) Probe ¶
func (i *IdentityServer) Probe(_ context.Context, _ *csi.ProbeRequest) (*csi.ProbeResponse, error)
Probe detect whether the plugin is running. 探测检查插件是否正在运行, 此方法不需要返回任何内容, 而且截至目前,规范也没有规定该返回什么, so, 返回nil
type NodeServer ¶
type NodeServer struct {
*common.DefaultNodeServer
}
func NewNodeServer ¶
func NewNodeServer(d *common.CSIDriver) *NodeServer
NewNodeServer creates a new node server.
func (*NodeServer) NodeExpandVolume ¶
func (n *NodeServer) NodeExpandVolume(_ context.Context, _ *csi.NodeExpandVolumeRequest) (*csi.NodeExpandVolumeResponse, error)
NodeExpandVolume implements csi.NodeServer.
func (*NodeServer) NodeGetCapabilities ¶
func (n *NodeServer) NodeGetCapabilities(_ context.Context, _ *csi.NodeGetCapabilitiesRequest) (*csi.NodeGetCapabilitiesResponse, error)
NodeGetCapabilities implements csi.NodeServer. Returns the supported capabilities of the node server.
func (*NodeServer) NodeGetInfo ¶
func (n *NodeServer) NodeGetInfo(_ context.Context, _ *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error)
NodeGetInfo implements csi.NodeServer. Returns the supported capabilities of the node server.
func (*NodeServer) NodeGetVolumeStats ¶
func (n *NodeServer) NodeGetVolumeStats(_ context.Context, req *csi.NodeGetVolumeStatsRequest) (*csi.NodeGetVolumeStatsResponse, error)
NodeGetVolumeStats implements csi.NodeServer.
func (*NodeServer) NodePublishVolume ¶
func (n *NodeServer) NodePublishVolume(_ context.Context, req *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error)
NodePublishVolume implements csi.NodeServer. Mounts the volume.
func (*NodeServer) NodeStageVolume ¶
func (n *NodeServer) NodeStageVolume(_ context.Context, _ *csi.NodeStageVolumeRequest) (*csi.NodeStageVolumeResponse, error)
NodeStageVolume implements csi.NodeServer.
func (*NodeServer) NodeUnpublishVolume ¶
func (n *NodeServer) NodeUnpublishVolume(_ context.Context, req *csi.NodeUnpublishVolumeRequest) (*csi.NodeUnpublishVolumeResponse, error)
NodeUnpublishVolume implements csi.NodeServer. Unmounts the volume.
func (*NodeServer) NodeUnstageVolume ¶
func (n *NodeServer) NodeUnstageVolume(_ context.Context, _ *csi.NodeUnstageVolumeRequest) (*csi.NodeUnstageVolumeResponse, error)
NodeUnstageVolume implements csi.NodeServer.
type NonBlockingGRPCServer ¶
type NonBlockingGRPCServer interface { // Start starts the gRPC server and blocks until the server exits. Start(endponit string, is csi.IdentityServer, cs csi.ControllerServer, ns csi.NodeServer, mode bool) // WaitForStop blocks until the server is stopped. Wait() // Stop stops the gRPC server. Stop() // ForceStop stops the gRPC server immediately. ForceStop() }
type NonBlockingGRPCServerOptions ¶
type NonBlockingGRPCServerOptions struct {
// contains filtered or unexported fields
}
NonBlockingGRPCServerOptions contains the options for a non-blocking gRPC server.
func NewNonBlockingGRPCServerOptions ¶
func NewNonBlockingGRPCServerOptions() *NonBlockingGRPCServerOptions
NewNonBlockingGRPCServerOptions returns a new NonBlockingGRPCServerOptions.
func (*NonBlockingGRPCServerOptions) ForceStop ¶
func (s *NonBlockingGRPCServerOptions) ForceStop()
ForceStop stops the gRPC server immediately.
func (*NonBlockingGRPCServerOptions) Start ¶
func (s *NonBlockingGRPCServerOptions) Start(endponit string, is csi.IdentityServer, cs csi.ControllerServer, ns csi.NodeServer, mode bool)
Start starts the gRPC server and blocks until the server exits.
func (*NonBlockingGRPCServerOptions) Stop ¶
func (s *NonBlockingGRPCServerOptions) Stop()
Stop stops the gRPC server.
func (*NonBlockingGRPCServerOptions) Wait ¶
func (s *NonBlockingGRPCServerOptions) Wait()
WaitForStop blocks until the server is stopped.