Documentation
¶
Index ¶
- Constants
- func NewFakeDisk(stdCapacityRangetest *csi.CapacityRange) compute.Disk
- func NewFakeSnapshot(diskId, location string) compute.Snapshot
- func NewFakeVm(dataDisk []compute.DataDisk) *compute.VirtualMachine
- func NewMounter() *mounter
- func ValidateControllerPublishVolume(req *csi.ControllerPublishVolumeRequest) error
- func ValidateControllerUnPublishVolume(req *csi.ControllerUnpublishVolumeRequest) error
- func ValidateCreateSnapshot(req *csi.CreateSnapshotRequest) error
- func ValidateCreateVolume(req *csi.CreateVolumeRequest) (int64, error)
- func ValidateNodePublishVolumeRequest(req *csi.NodePublishVolumeRequest) error
- func ValidateNodeStageVolumeRequest(req *csi.NodeStageVolumeRequest) error
- func ValidateNodeUnPublishVolume(req *csi.NodeUnpublishVolumeRequest) error
- func ValidateValidateNodeUnStageVolumeRequest(volumeID string, req *csi.NodeUnstageVolumeRequest) error
- type Driver
- func (d *Driver) ControllerExpandVolume(ctx context.Context, request *csi.ControllerExpandVolumeRequest) (*csi.ControllerExpandVolumeResponse, error)
- func (d *Driver) ControllerGetCapabilities(ctx context.Context, req *csi.ControllerGetCapabilitiesRequest) (*csi.ControllerGetCapabilitiesResponse, error)
- func (d *Driver) ControllerGetVolume(ctx context.Context, request *csi.ControllerGetVolumeRequest) (*csi.ControllerGetVolumeResponse, error)
- func (d *Driver) ControllerPublishVolume(ctx context.Context, req *csi.ControllerPublishVolumeRequest) (*csi.ControllerPublishVolumeResponse, error)
- func (d *Driver) ControllerUnpublishVolume(ctx context.Context, req *csi.ControllerUnpublishVolumeRequest) (*csi.ControllerUnpublishVolumeResponse, error)
- func (d *Driver) CreateSnapshot(ctx context.Context, req *csi.CreateSnapshotRequest) (*csi.CreateSnapshotResponse, error)
- func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest) (*csi.CreateVolumeResponse, error)
- func (d *Driver) DeleteSnapshot(ctx context.Context, req *csi.DeleteSnapshotRequest) (*csi.DeleteSnapshotResponse, error)
- func (d *Driver) DeleteVolume(ctx context.Context, req *csi.DeleteVolumeRequest) (*csi.DeleteVolumeResponse, error)
- func (d *Driver) GetCapacity(ctx context.Context, request *csi.GetCapacityRequest) (*csi.GetCapacityResponse, error)
- func (d *Driver) GetCloud() *azure.Cloud
- func (d *Driver) GetDiskUri(volume string) string
- func (d *Driver) GetPluginCapabilities(context.Context, *csi.GetPluginCapabilitiesRequest) (*csi.GetPluginCapabilitiesResponse, error)
- func (d *Driver) GetPluginInfo(context.Context, *csi.GetPluginInfoRequest) (*csi.GetPluginInfoResponse, error)
- func (d *Driver) ListSnapshots(ctx context.Context, request *csi.ListSnapshotsRequest) (*csi.ListSnapshotsResponse, error)
- func (d *Driver) ListVolumes(ctx context.Context, request *csi.ListVolumesRequest) (*csi.ListVolumesResponse, error)
- func (d *Driver) NodeExpandVolume(ctx context.Context, request *csi.NodeExpandVolumeRequest) (*csi.NodeExpandVolumeResponse, error)
- func (d *Driver) NodeGetCapabilities(ctx context.Context, request *csi.NodeGetCapabilitiesRequest) (*csi.NodeGetCapabilitiesResponse, error)
- func (d *Driver) NodeGetInfo(ctx context.Context, request *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error)
- func (d *Driver) NodeGetVolumeStats(ctx context.Context, req *csi.NodeGetVolumeStatsRequest) (*csi.NodeGetVolumeStatsResponse, error)
- func (d *Driver) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error)
- func (d *Driver) NodeStageVolume(ctx context.Context, req *csi.NodeStageVolumeRequest) (*csi.NodeStageVolumeResponse, error)
- func (d *Driver) NodeUnpublishVolume(ctx context.Context, req *csi.NodeUnpublishVolumeRequest) (*csi.NodeUnpublishVolumeResponse, error)
- func (d *Driver) NodeUnstageVolume(ctx context.Context, req *csi.NodeUnstageVolumeRequest) (*csi.NodeUnstageVolumeResponse, error)
- func (d *Driver) Probe(ctx context.Context, req *csi.ProbeRequest) (*csi.ProbeResponse, error)
- func (d *Driver) Run(ctx context.Context) error
- func (d *Driver) SetLog(log *logrus.Entry)
- func (d *Driver) ValidateVolumeCapabilities(ctx context.Context, req *csi.ValidateVolumeCapabilitiesRequest) (*csi.ValidateVolumeCapabilitiesResponse, error)
- type IoHandler
- type Mounter
- type VolumeStatistics
Constants ¶
const (
DefaultDriverName = "ananas.noah.csi.com"
)
const (
FakeEndPoint = "unix:///tmp/csi.sock"
)
Variables ¶
This section is empty.
Functions ¶
func NewFakeDisk ¶
func NewFakeDisk(stdCapacityRangetest *csi.CapacityRange) compute.Disk
NewFakeDisk return fake disk for mock
func NewFakeSnapshot ¶
func NewFakeVm ¶
func NewFakeVm(dataDisk []compute.DataDisk) *compute.VirtualMachine
NewFakeVm return fake vm for mock
func ValidateControllerPublishVolume ¶
func ValidateControllerPublishVolume(req *csi.ControllerPublishVolumeRequest) error
ValidateControllerPublishVolume validates the controller publish volume request.
func ValidateControllerUnPublishVolume ¶
func ValidateControllerUnPublishVolume(req *csi.ControllerUnpublishVolumeRequest) error
ValidateControllerUnPublishVolume validates the controller unpublish volume request.
func ValidateCreateSnapshot ¶
func ValidateCreateSnapshot(req *csi.CreateSnapshotRequest) error
ValidateCreateSnapshot validates the snapshot request
func ValidateCreateVolume ¶
func ValidateCreateVolume(req *csi.CreateVolumeRequest) (int64, error)
ValidateCreateVolume validates the create volume request.
func ValidateNodePublishVolumeRequest ¶
func ValidateNodePublishVolumeRequest(req *csi.NodePublishVolumeRequest) error
ValidateNodePublishVolumeRequest validates the node publish volume request.
func ValidateNodeStageVolumeRequest ¶
func ValidateNodeStageVolumeRequest(req *csi.NodeStageVolumeRequest) error
ValidateNodeStageVolumeRequest validates the node stage request.
func ValidateNodeUnPublishVolume ¶
func ValidateNodeUnPublishVolume(req *csi.NodeUnpublishVolumeRequest) error
ValidateNodeUnPublishVolume validates the node unpublish volume request.
func ValidateValidateNodeUnStageVolumeRequest ¶
func ValidateValidateNodeUnStageVolumeRequest(volumeID string, req *csi.NodeUnstageVolumeRequest) error
ValidateValidateNodeUnStageVolumeRequest validates the node unstage volume request.
Types ¶
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
Driver CSI Driver
func NewDriver ¶
NewDriver returns a CSI plugin that contains the necessary gRPC interfaces to interact with Kubernetes over unix domain sockets for managing DigitalOcean Block Storage
func NewFakeDriver ¶
NewFakeDriver use test cloud for mock
func (*Driver) ControllerExpandVolume ¶
func (d *Driver) ControllerExpandVolume(ctx context.Context, request *csi.ControllerExpandVolumeRequest) (*csi.ControllerExpandVolumeResponse, error)
ControllerExpandVolume is called from the resizer to increase the volume size.
func (*Driver) ControllerGetCapabilities ¶
func (d *Driver) ControllerGetCapabilities(ctx context.Context, req *csi.ControllerGetCapabilitiesRequest) (*csi.ControllerGetCapabilitiesResponse, error)
ControllerGetCapabilities returns the capabilities of the controller service.
func (*Driver) ControllerGetVolume ¶
func (d *Driver) ControllerGetVolume(ctx context.Context, request *csi.ControllerGetVolumeRequest) (*csi.ControllerGetVolumeResponse, error)
ControllerGetVolume gets a specific volume. The call is used for the CSI health check feature (https://github.com/kubernetes/enhancements/pull/1077) which we do not support yet.
func (*Driver) ControllerPublishVolume ¶
func (d *Driver) ControllerPublishVolume(ctx context.Context, req *csi.ControllerPublishVolumeRequest) (*csi.ControllerPublishVolumeResponse, error)
ControllerPublishVolume call azure api to attach azure-disk to specified vm
func (*Driver) ControllerUnpublishVolume ¶
func (d *Driver) ControllerUnpublishVolume(ctx context.Context, req *csi.ControllerUnpublishVolumeRequest) (*csi.ControllerUnpublishVolumeResponse, error)
ControllerUnpublishVolume call azure api to detach azure-disk from specified vm
func (*Driver) CreateSnapshot ¶
func (d *Driver) CreateSnapshot(ctx context.Context, req *csi.CreateSnapshotRequest) (*csi.CreateSnapshotResponse, error)
CreateSnapshot will be called by the CO to create a new snapshot from a source volume on behalf of a user.
func (*Driver) CreateVolume ¶
func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest) (*csi.CreateVolumeResponse, error)
CreateVolume call azure api to create managed disk
func (*Driver) DeleteSnapshot ¶
func (d *Driver) DeleteSnapshot(ctx context.Context, req *csi.DeleteSnapshotRequest) (*csi.DeleteSnapshotResponse, error)
DeleteSnapshot will be called by the CO to delete a snapshot.
func (*Driver) DeleteVolume ¶
func (d *Driver) DeleteVolume(ctx context.Context, req *csi.DeleteVolumeRequest) (*csi.DeleteVolumeResponse, error)
DeleteVolume call azure api to delete managed disk
func (*Driver) GetCapacity ¶
func (d *Driver) GetCapacity(ctx context.Context, request *csi.GetCapacityRequest) (*csi.GetCapacityResponse, error)
GetCapacity returns the capacity of the storage pool
func (*Driver) GetDiskUri ¶
GetDiskUri use to get azure disk uri from volume
func (*Driver) GetPluginCapabilities ¶
func (d *Driver) GetPluginCapabilities(context.Context, *csi.GetPluginCapabilitiesRequest) (*csi.GetPluginCapabilitiesResponse, error)
GetPluginCapabilities returns available capabilities of the plugin
func (*Driver) GetPluginInfo ¶
func (d *Driver) GetPluginInfo(context.Context, *csi.GetPluginInfoRequest) (*csi.GetPluginInfoResponse, error)
GetPluginInfo returns metadata of the plugin
func (*Driver) ListSnapshots ¶
func (d *Driver) ListSnapshots(ctx context.Context, request *csi.ListSnapshotsRequest) (*csi.ListSnapshotsResponse, error)
ListSnapshots returns the information about all snapshots on the storage system within the given parameters regardless of how they were created. ListSnapshots shold not list a snapshot that is being created but has not been cut successfully yet.
func (*Driver) ListVolumes ¶
func (d *Driver) ListVolumes(ctx context.Context, request *csi.ListVolumesRequest) (*csi.ListVolumesResponse, error)
ListVolumes should list resource by resource group with pagination or list pv from k8s cluster
func (*Driver) NodeExpandVolume ¶
func (d *Driver) NodeExpandVolume(ctx context.Context, request *csi.NodeExpandVolumeRequest) (*csi.NodeExpandVolumeResponse, error)
NodeExpandVolume shoud call azure api to expand azure-disk
func (*Driver) NodeGetCapabilities ¶
func (d *Driver) NodeGetCapabilities(ctx context.Context, request *csi.NodeGetCapabilitiesRequest) (*csi.NodeGetCapabilitiesResponse, error)
NodeGetCapabilities returns the supported capabilities of the node server
func (*Driver) NodeGetInfo ¶
func (d *Driver) NodeGetInfo(ctx context.Context, request *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error)
NodeGetInfo returns the supported capabilities of the node server. This should eventually return the droplet ID if possible. This is used so the CO knows where to place the workload. The result of this function will be used by the CO in ControllerPublishVolume.
func (*Driver) NodeGetVolumeStats ¶
func (d *Driver) NodeGetVolumeStats(ctx context.Context, req *csi.NodeGetVolumeStatsRequest) (*csi.NodeGetVolumeStatsResponse, error)
NodeGetVolumeStats returns the volume capacity statistics available for the the given volume.
func (*Driver) NodePublishVolume ¶
func (d *Driver) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error)
NodePublishVolume mounts the volume mounted to the staging path to the target path
func (*Driver) NodeStageVolume ¶
func (d *Driver) NodeStageVolume(ctx context.Context, req *csi.NodeStageVolumeRequest) (*csi.NodeStageVolumeResponse, error)
NodeStageVolume mounts the volume to a staging path on the node. This is called by the CO before NodePublishVolume and is used to temporary mount the volume to a staging path. Once mounted, NodePublishVolume will make sure to mount it to the appropriate path staging path always is a directory
func (*Driver) NodeUnpublishVolume ¶
func (d *Driver) NodeUnpublishVolume(ctx context.Context, req *csi.NodeUnpublishVolumeRequest) (*csi.NodeUnpublishVolumeResponse, error)
NodeUnpublishVolume unmounts the volume from the target path
func (*Driver) NodeUnstageVolume ¶
func (d *Driver) NodeUnstageVolume(ctx context.Context, req *csi.NodeUnstageVolumeRequest) (*csi.NodeUnstageVolumeResponse, error)
NodeUnstageVolume unstages the volume from the staging path
func (*Driver) Probe ¶
func (d *Driver) Probe(ctx context.Context, req *csi.ProbeRequest) (*csi.ProbeResponse, error)
Probe returns the health and readiness of the plugin
func (*Driver) ValidateVolumeCapabilities ¶
func (d *Driver) ValidateVolumeCapabilities(ctx context.Context, req *csi.ValidateVolumeCapabilitiesRequest) (*csi.ValidateVolumeCapabilitiesResponse, error)
ValidateVolumeCapabilities validate VolumeCapability
type IoHandler ¶
type IoHandler interface { ReadDir(dirname string) ([]os.FileInfo, error) WriteFile(filename string, data []byte, perm os.FileMode) error Readlink(name string) (string, error) ReadFile(filename string) ([]byte, error) }
IoHandler for system operations
func NewIOHandler ¶
func NewIOHandler() IoHandler
NewIOHandler Create a new IoHandler implementation
type Mounter ¶
type Mounter interface { // Format formats the source with the given filesystem type Format(source, fsType string) error // Mount mounts source to target with the given fstype and options. Mount(source, target, fsType string, options ...string) error // Unmount unmounts the given target Unmount(target string) error // IsFormatted checks whether the source device is formatted or not. It // returns true if the source device is already formatted. IsFormatted(source string) (bool, error) // IsMounted checks whether the target path is a correct mount (i.e: // propagated). It returns true if it's mounted. An error is returned in // case of system errors or if it's mounted incorrectly. IsMounted(target string) (bool, error) GetDeviceName(mounter mount.Interface, mountPath string) (string, error) // GetStatistics returns capacity-related volume statistics for the given // volume path. GetStatistics(volumePath string) (VolumeStatistics, error) }
Mounter for mounting operations