Documentation ¶
Index ¶
- Constants
- func CleanupMountPoint(path string, m *mount.SafeFormatAndMount, extensiveCheck bool) error
- func GetUserAgent(driverName, customUserAgent, userAgentSuffix string) string
- func GetVersionYAML(driverName string) (string, error)
- func GetVolumeStats(_ context.Context, m *mount.SafeFormatAndMount, target string, ...) ([]*csi.VolumeUsage, error)
- func InitOtelTracing() (*otlptrace.Exporter, error)
- type CSIDriver
- type Driver
- func (d *Driver) ControllerExpandVolume(ctx context.Context, req *csi.ControllerExpandVolumeRequest) (*csi.ControllerExpandVolumeResponse, error)
- func (d *Driver) ControllerGetCapabilities(_ context.Context, _ *csi.ControllerGetCapabilitiesRequest) (*csi.ControllerGetCapabilitiesResponse, error)
- func (d *Driver) ControllerGetVolume(context.Context, *csi.ControllerGetVolumeRequest) (*csi.ControllerGetVolumeResponse, error)
- func (d *Driver) ControllerModifyVolume(context.Context, *csi.ControllerModifyVolumeRequest) (*csi.ControllerModifyVolumeResponse, 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(_ context.Context, _ *csi.GetCapacityRequest) (*csi.GetCapacityResponse, error)
- func (f *Driver) GetPluginCapabilities(_ context.Context, _ *csi.GetPluginCapabilitiesRequest) (*csi.GetPluginCapabilitiesResponse, error)
- func (f *Driver) GetPluginInfo(_ context.Context, _ *csi.GetPluginInfoRequest) (*csi.GetPluginInfoResponse, error)
- func (d *Driver) GetSourceDiskSize(ctx context.Context, subsID, resourceGroup, diskName string, ...) (*int32, error)
- func (d *Driver) ListSnapshots(ctx context.Context, req *csi.ListSnapshotsRequest) (*csi.ListSnapshotsResponse, error)
- func (d *Driver) ListVolumes(ctx context.Context, req *csi.ListVolumesRequest) (*csi.ListVolumesResponse, error)
- func (d *Driver) NodeExpandVolume(_ context.Context, req *csi.NodeExpandVolumeRequest) (*csi.NodeExpandVolumeResponse, error)
- func (d *Driver) NodeGetCapabilities(_ context.Context, _ *csi.NodeGetCapabilitiesRequest) (*csi.NodeGetCapabilitiesResponse, error)
- func (d *Driver) NodeGetInfo(ctx context.Context, _ *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error)
- func (d *Driver) NodeGetVolumeStats(ctx context.Context, req *csi.NodeGetVolumeStatsRequest) (*csi.NodeGetVolumeStatsResponse, error)
- func (d *Driver) NodePublishVolume(_ context.Context, req *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error)
- func (d *Driver) NodeStageVolume(_ context.Context, req *csi.NodeStageVolumeRequest) (*csi.NodeStageVolumeResponse, error)
- func (d *Driver) NodeUnpublishVolume(_ context.Context, req *csi.NodeUnpublishVolumeRequest) (*csi.NodeUnpublishVolumeResponse, error)
- func (d *Driver) NodeUnstageVolume(_ context.Context, req *csi.NodeUnstageVolumeRequest) (*csi.NodeUnstageVolumeResponse, error)
- func (f *Driver) Probe(_ context.Context, _ *csi.ProbeRequest) (*csi.ProbeResponse, error)
- func (d *Driver) Run(ctx context.Context) error
- func (d *Driver) ValidateVolumeCapabilities(ctx context.Context, req *csi.ValidateVolumeCapabilitiesRequest) (*csi.ValidateVolumeCapabilitiesResponse, error)
- type DriverCore
- type DriverOptions
- type ExtendedLocation
- type FakeDriver
- type ManagedDiskController
- func (c ManagedDiskController) AttachDisk(ctx context.Context, diskName, diskURI string, nodeName types.NodeName, ...) (int32, error)
- func (c *ManagedDiskController) CreateManagedDisk(ctx context.Context, options *ManagedDiskOptions) (string, error)
- func (c *ManagedDiskController) DeleteManagedDisk(ctx context.Context, diskURI string) error
- func (c ManagedDiskController) DetachDisk(ctx context.Context, diskName, diskURI string, nodeName types.NodeName) error
- func (c ManagedDiskController) DisksAreAttached(diskNames []string, nodeName types.NodeName) (map[string]bool, error)
- func (c *ManagedDiskController) GetDisk(ctx context.Context, subsID, resourceGroup, diskName string) (string, string, error)
- func (c ManagedDiskController) GetDiskLun(diskName, diskURI string, nodeName types.NodeName) (int32, *string, error)
- func (c ManagedDiskController) GetNodeDataDisks(nodeName types.NodeName, crt azcache.AzureCacheReadType) ([]*armcompute.DataDisk, *string, error)
- func (c *ManagedDiskController) ResizeDisk(ctx context.Context, diskURI string, oldSize resource.Quantity, ...) (resource.Quantity, error)
- func (c ManagedDiskController) SetDiskLun(nodeName types.NodeName, diskURI string, ...) (int32, error)
- func (c ManagedDiskController) UpdateVM(ctx context.Context, nodeName types.NodeName) error
- type ManagedDiskOptions
- type VersionInfo
Constants ¶
const ( // WriteAcceleratorEnabled support for Azure Write Accelerator on Azure Disks // https://docs.microsoft.com/azure/virtual-machines/windows/how-to-enable-write-accelerator WriteAcceleratorEnabled = "writeacceleratorenabled" )
Variables ¶
This section is empty.
Functions ¶
func CleanupMountPoint ¶ added in v0.7.0
func CleanupMountPoint(path string, m *mount.SafeFormatAndMount, extensiveCheck bool) error
func GetUserAgent ¶ added in v1.6.0
GetUserAgent returns user agent of the driver
func GetVersionYAML ¶
GetVersionYAML returns the version information of the driver in YAML format
func GetVolumeStats ¶ added in v1.19.0
func GetVolumeStats(_ context.Context, m *mount.SafeFormatAndMount, target string, hostutil hostUtil) ([]*csi.VolumeUsage, error)
func InitOtelTracing ¶ added in v1.29.0
Types ¶
type CSIDriver ¶ added in v1.1.1
type CSIDriver interface { csi.ControllerServer csi.NodeServer csi.IdentityServer Run(ctx context.Context) error }
CSIDriver defines the interface for a CSI driver.
func NewDriver ¶
func NewDriver(options *DriverOptions) CSIDriver
NewDriver Creates a NewCSIDriver object. Assumes vendor version is equal to driver version & does not support optional driver plugin info manifest field. Refer to CSI spec for more details.
type Driver ¶
type Driver struct { DriverCore // contains filtered or unexported fields }
Driver is the v1 implementation of the Azure Disk CSI Driver.
func (*Driver) ControllerExpandVolume ¶
func (d *Driver) ControllerExpandVolume(ctx context.Context, req *csi.ControllerExpandVolumeRequest) (*csi.ControllerExpandVolumeResponse, error)
ControllerExpandVolume controller expand volume
func (*Driver) ControllerGetCapabilities ¶
func (d *Driver) ControllerGetCapabilities(_ context.Context, _ *csi.ControllerGetCapabilitiesRequest) (*csi.ControllerGetCapabilitiesResponse, error)
ControllerGetCapabilities returns the capabilities of the Controller plugin
func (*Driver) ControllerGetVolume ¶ added in v0.8.0
func (d *Driver) ControllerGetVolume(context.Context, *csi.ControllerGetVolumeRequest) (*csi.ControllerGetVolumeResponse, error)
ControllerGetVolume get volume
func (*Driver) ControllerModifyVolume ¶ added in v1.30.0
func (d *Driver) ControllerModifyVolume(context.Context, *csi.ControllerModifyVolumeRequest) (*csi.ControllerModifyVolumeResponse, error)
ControllerModifyVolume modify volume
func (*Driver) ControllerPublishVolume ¶
func (d *Driver) ControllerPublishVolume(ctx context.Context, req *csi.ControllerPublishVolumeRequest) (*csi.ControllerPublishVolumeResponse, error)
ControllerPublishVolume attach an azure disk to a required node
func (*Driver) ControllerUnpublishVolume ¶
func (d *Driver) ControllerUnpublishVolume(ctx context.Context, req *csi.ControllerUnpublishVolumeRequest) (*csi.ControllerUnpublishVolumeResponse, error)
ControllerUnpublishVolume detach an azure disk from a required node
func (*Driver) CreateSnapshot ¶
func (d *Driver) CreateSnapshot(ctx context.Context, req *csi.CreateSnapshotRequest) (*csi.CreateSnapshotResponse, error)
CreateSnapshot create a snapshot
func (*Driver) CreateVolume ¶
func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest) (*csi.CreateVolumeResponse, error)
CreateVolume provisions an azure disk
func (*Driver) DeleteSnapshot ¶
func (d *Driver) DeleteSnapshot(ctx context.Context, req *csi.DeleteSnapshotRequest) (*csi.DeleteSnapshotResponse, error)
DeleteSnapshot delete a snapshot
func (*Driver) DeleteVolume ¶
func (d *Driver) DeleteVolume(ctx context.Context, req *csi.DeleteVolumeRequest) (*csi.DeleteVolumeResponse, error)
DeleteVolume delete an azure disk
func (*Driver) GetCapacity ¶
func (d *Driver) GetCapacity(_ context.Context, _ *csi.GetCapacityRequest) (*csi.GetCapacityResponse, error)
GetCapacity returns the capacity of the total available storage pool
func (*Driver) GetPluginCapabilities ¶
func (f *Driver) GetPluginCapabilities(_ context.Context, _ *csi.GetPluginCapabilitiesRequest) (*csi.GetPluginCapabilitiesResponse, error)
GetPluginCapabilities returns the capabilities of the plugin
func (*Driver) GetPluginInfo ¶
func (f *Driver) GetPluginInfo(_ context.Context, _ *csi.GetPluginInfoRequest) (*csi.GetPluginInfoResponse, error)
GetPluginInfo return the version and name of the plugin
func (*Driver) GetSourceDiskSize ¶ added in v1.0.0
func (d *Driver) GetSourceDiskSize(ctx context.Context, subsID, resourceGroup, diskName string, curDepth, maxDepth int) (*int32, error)
GetSourceDiskSize recursively searches for the sourceDisk and returns: sourceDisk disk size, error
func (*Driver) ListSnapshots ¶
func (d *Driver) ListSnapshots(ctx context.Context, req *csi.ListSnapshotsRequest) (*csi.ListSnapshotsResponse, error)
ListSnapshots list all snapshots
func (*Driver) ListVolumes ¶
func (d *Driver) ListVolumes(ctx context.Context, req *csi.ListVolumesRequest) (*csi.ListVolumesResponse, error)
ListVolumes return all available volumes
func (*Driver) NodeExpandVolume ¶
func (d *Driver) NodeExpandVolume(_ context.Context, req *csi.NodeExpandVolumeRequest) (*csi.NodeExpandVolumeResponse, error)
NodeExpandVolume node expand volume
func (*Driver) NodeGetCapabilities ¶
func (d *Driver) NodeGetCapabilities(_ context.Context, _ *csi.NodeGetCapabilitiesRequest) (*csi.NodeGetCapabilitiesResponse, error)
NodeGetCapabilities return the capabilities of the Node plugin
func (*Driver) NodeGetInfo ¶
func (d *Driver) NodeGetInfo(ctx context.Context, _ *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error)
NodeGetInfo return info of the node on which this plugin is running
func (*Driver) NodeGetVolumeStats ¶
func (d *Driver) NodeGetVolumeStats(ctx context.Context, req *csi.NodeGetVolumeStatsRequest) (*csi.NodeGetVolumeStatsResponse, error)
func (*Driver) NodePublishVolume ¶
func (d *Driver) NodePublishVolume(_ context.Context, req *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error)
NodePublishVolume mount the volume from staging to target path
func (*Driver) NodeStageVolume ¶
func (d *Driver) NodeStageVolume(_ context.Context, req *csi.NodeStageVolumeRequest) (*csi.NodeStageVolumeResponse, error)
NodeStageVolume mount disk device to a staging path
func (*Driver) NodeUnpublishVolume ¶
func (d *Driver) NodeUnpublishVolume(_ context.Context, req *csi.NodeUnpublishVolumeRequest) (*csi.NodeUnpublishVolumeResponse, error)
NodeUnpublishVolume unmount the volume from the target path
func (*Driver) NodeUnstageVolume ¶
func (d *Driver) NodeUnstageVolume(_ context.Context, req *csi.NodeUnstageVolumeRequest) (*csi.NodeUnstageVolumeResponse, error)
NodeUnstageVolume unmount disk device from a staging path
func (*Driver) Probe ¶
func (f *Driver) 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
func (*Driver) ValidateVolumeCapabilities ¶
func (d *Driver) ValidateVolumeCapabilities(ctx context.Context, req *csi.ValidateVolumeCapabilitiesRequest) (*csi.ValidateVolumeCapabilitiesResponse, error)
ValidateVolumeCapabilities return the capabilities of the volume
type DriverCore ¶ added in v1.1.1
DriverCore contains fields common to both the V1 and V2 driver, and implements all interfaces of CSI drivers
type DriverOptions ¶ added in v1.5.0
type DriverOptions struct { // Common options NodeID string DriverName string VolumeAttachLimit int64 ReservedDataDiskSlotNum int64 EnablePerfOptimization bool CloudConfigSecretName string CloudConfigSecretNamespace string CustomUserAgent string UserAgentSuffix string UseCSIProxyGAInterface bool EnableOtelTracing bool //only used in v1 EnableDiskOnlineResize bool AllowEmptyCloudConfig bool EnableListVolumes bool EnableListSnapshots bool SupportZone bool GetNodeInfoFromLabels bool EnableDiskCapacityCheck bool DisableUpdateCache bool EnableTrafficManager bool TrafficManagerPort int64 AttachDetachInitialDelayInMs int64 VMSSCacheTTLInSeconds int64 VMType string EnableWindowsHostProcess bool GetNodeIDFromIMDS bool WaitForSnapshotReady bool CheckDiskLUNCollision bool Kubeconfig string Endpoint string DisableAVSetNodes bool }
DriverOptions defines driver parameters specified in driver deployment
func (*DriverOptions) AddFlags ¶ added in v1.30.0
func (o *DriverOptions) AddFlags() *flag.FlagSet
type ExtendedLocation ¶ added in v1.30.0
type ExtendedLocation struct { // Name - The name of the extended location. Name string `json:"name,omitempty"` // Type - The type of the extended location. Type string `json:"type,omitempty"` }
ExtendedLocation contains additional info about the location of resources.
type FakeDriver ¶ added in v1.1.1
type FakeDriver interface { CSIDriver GetSourceDiskSize(ctx context.Context, subsID, resourceGroup, diskName string, curDepth, maxDepth int) (*int32, error) // contains filtered or unexported methods }
FakeDriver defines an interface unit tests use to test either the v1 or v2 implementation of the Azure Disk CSI Driver.
func NewFakeDriver ¶ added in v0.7.0
func NewFakeDriver(t *gomock.Controller) (FakeDriver, error)
NewFakeDriver returns a driver implementation suitable for use in unit tests.
type ManagedDiskController ¶ added in v1.30.0
type ManagedDiskController struct {
// contains filtered or unexported fields
}
ManagedDiskController : managed disk controller struct
func NewManagedDiskController ¶ added in v1.30.0
func NewManagedDiskController(provider *provider.Cloud) *ManagedDiskController
func (ManagedDiskController) AttachDisk ¶ added in v1.30.0
func (c ManagedDiskController) AttachDisk(ctx context.Context, diskName, diskURI string, nodeName types.NodeName, cachingMode armcompute.CachingTypes, disk *armcompute.Disk, occupiedLuns []int) (int32, error)
AttachDisk attaches a disk to vm occupiedLuns is used to avoid conflict with other disk attach in k8s VolumeAttachments return (lun, error)
func (*ManagedDiskController) CreateManagedDisk ¶ added in v1.30.0
func (c *ManagedDiskController) CreateManagedDisk(ctx context.Context, options *ManagedDiskOptions) (string, error)
CreateManagedDisk: create managed disk
func (*ManagedDiskController) DeleteManagedDisk ¶ added in v1.30.0
func (c *ManagedDiskController) DeleteManagedDisk(ctx context.Context, diskURI string) error
DeleteManagedDisk : delete managed disk
func (ManagedDiskController) DetachDisk ¶ added in v1.30.0
func (c ManagedDiskController) DetachDisk(ctx context.Context, diskName, diskURI string, nodeName types.NodeName) error
DetachDisk detaches a disk from VM
func (ManagedDiskController) DisksAreAttached ¶ added in v1.30.0
func (c ManagedDiskController) DisksAreAttached(diskNames []string, nodeName types.NodeName) (map[string]bool, error)
DisksAreAttached checks if a list of volumes are attached to the node with the specified NodeName.
func (*ManagedDiskController) GetDisk ¶ added in v1.30.0
func (c *ManagedDiskController) GetDisk(ctx context.Context, subsID, resourceGroup, diskName string) (string, string, error)
GetDisk return: disk provisionState, diskID, error
func (ManagedDiskController) GetDiskLun ¶ added in v1.30.0
func (c ManagedDiskController) GetDiskLun(diskName, diskURI string, nodeName types.NodeName) (int32, *string, error)
GetDiskLun finds the lun on the host that the vhd is attached to, given a vhd's diskName and diskURI.
func (ManagedDiskController) GetNodeDataDisks ¶ added in v1.30.0
func (c ManagedDiskController) GetNodeDataDisks(nodeName types.NodeName, crt azcache.AzureCacheReadType) ([]*armcompute.DataDisk, *string, error)
GetNodeDataDisks invokes vmSet interfaces to get data disks for the node.
func (*ManagedDiskController) ResizeDisk ¶ added in v1.30.0
func (c *ManagedDiskController) ResizeDisk(ctx context.Context, diskURI string, oldSize resource.Quantity, newSize resource.Quantity, supportOnlineResize bool) (resource.Quantity, error)
ResizeDisk Expand the disk to new size
func (ManagedDiskController) SetDiskLun ¶ added in v1.30.0
func (c ManagedDiskController) SetDiskLun(nodeName types.NodeName, diskURI string, diskMap map[string]*provider.AttachDiskOptions, occupiedLuns []int) (int32, error)
SetDiskLun find unused luns and allocate lun for every disk in diskMap. occupiedLuns is used to avoid conflict with other disk attach in k8s VolumeAttachments Return lun of diskURI, -1 if all luns are used.
type ManagedDiskOptions ¶
type ManagedDiskOptions struct { // The SKU of storage account. StorageAccountType armcompute.DiskStorageAccountTypes // The name of the disk. DiskName string // The name of PVC. PVCName string // The name of resource group. ResourceGroup string // The AvailabilityZone to create the disk. AvailabilityZone string // The tags of the disk. Tags map[string]string // IOPS Caps for UltraSSD disk DiskIOPSReadWrite string // Throughput Cap (MBps) for UltraSSD disk DiskMBpsReadWrite string // if SourceResourceID is not empty, then it's a disk copy operation(for snapshot) SourceResourceID string // The type of source SourceType string // ResourceId of the disk encryption set to use for enabling encryption at rest. DiskEncryptionSetID string // DiskEncryption type, available values: EncryptionAtRestWithCustomerKey, EncryptionAtRestWithPlatformAndCustomerKeys DiskEncryptionType string // The size in GB. SizeGB int MaxShares int32 // Logical sector size in bytes for Ultra disks LogicalSectorSize int32 // SkipGetDiskOperation indicates whether skip GetDisk operation(mainly due to throttling) SkipGetDiskOperation bool // PublicNetworkAccess - Possible values include: 'Enabled', 'Disabled' PublicNetworkAccess armcompute.PublicNetworkAccess // NetworkAccessPolicy - Possible values include: 'AllowAll', 'AllowPrivate', 'DenyAll' NetworkAccessPolicy armcompute.NetworkAccessPolicy // DiskAccessID - ARM id of the DiskAccess resource for using private endpoints on disks. DiskAccessID *string // BurstingEnabled - Set to true to enable bursting beyond the provisioned performance target of the disk. BurstingEnabled *bool // SubscriptionID - specify a different SubscriptionID SubscriptionID string // Location - specify a different location Location string // PerformancePlus - Set this flag to true to get a boost on the performance target of the disk deployed PerformancePlus *bool }
ManagedDiskOptions specifies the options of managed disks.
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"` TopologyKey string `json:"Topology Key"` }
VersionInfo holds the version information of the driver
func GetVersion ¶
func GetVersion(driverName string) VersionInfo
GetVersion returns the version information of the driver
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package mockcorev1 implements the mock client for corev1.
|
Package mockcorev1 implements the mock client for corev1. |
Package mockkubeclient implements the mock client for kubeclient.
|
Package mockkubeclient implements the mock client for kubeclient. |
Package mockpersistentvolume implements the mock client for persistentvolumegetter.
|
Package mockpersistentvolume implements the mock client for persistentvolumegetter. |