azuredisk

package
v1.28.7 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 44 Imported by: 3

Documentation

Index

Constants

This section is empty.

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

func GetUserAgent(driverName, customUserAgent, userAgentSuffix string) string

GetUserAgent returns user agent of the driver

func GetVersionYAML

func GetVersionYAML(driverName string) (string, error)

GetVersionYAML returns the version information of the driver in YAML format

Types

type CSIDriver added in v1.1.1

type CSIDriver interface {
	csi.ControllerServer
	csi.NodeServer
	csi.IdentityServer

	Run(endpoint, kubeconfig string, disableAVSetNodes, testMode bool)
}

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

ControllerExpandVolume controller expand volume

func (*Driver) ControllerGetCapabilities

ControllerGetCapabilities returns the capabilities of the Controller plugin

func (*Driver) ControllerGetVolume added in v0.8.0

ControllerGetVolume get volume

func (*Driver) ControllerPublishVolume

ControllerPublishVolume attach an azure disk to a required node

func (*Driver) ControllerUnpublishVolume

ControllerUnpublishVolume detach an azure disk from a required node

func (*Driver) CreateSnapshot

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

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

GetCapacity returns the capacity of the total available storage pool

func (*Driver) GetPluginCapabilities

GetPluginCapabilities returns the capabilities of the plugin

func (*Driver) GetPluginInfo

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

NodeExpandVolume node expand volume

func (*Driver) NodeGetCapabilities

NodeGetCapabilities return the capabilities of the Node plugin

func (*Driver) NodeGetInfo

NodeGetInfo return info of the node on which this plugin is running

func (*Driver) NodeGetVolumeStats

func (*Driver) NodePublishVolume

NodePublishVolume mount the volume from staging to target path

func (*Driver) NodeStageVolume

NodeStageVolume mount disk device to a staging path

func (*Driver) NodeUnpublishVolume

NodeUnpublishVolume unmount the volume from the target path

func (*Driver) NodeUnstageVolume

NodeUnstageVolume unmount disk device from a staging path

func (*Driver) Probe

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) Run

func (d *Driver) Run(endpoint, kubeconfig string, disableAVSetNodes, testingMock bool)

Run driver initialization

func (*Driver) ValidateVolumeCapabilities

ValidateVolumeCapabilities return the capabilities of the volume

type DriverCore added in v1.1.1

type DriverCore struct {
	csicommon.CSIDriver
	// contains filtered or unexported fields
}

DriverCore contains fields common to both the V1 and V2 driver, and implements all interfaces of CSI drivers

func (*DriverCore) GetVolumeStats added in v1.28.7

func (d *DriverCore) GetVolumeStats(ctx context.Context, m *mount.SafeFormatAndMount, volumeID, target string, hostutil hostUtil) ([]*csi.VolumeUsage, error)

type DriverOptions added in v1.5.0

type DriverOptions struct {
	NodeID                       string
	DriverName                   string
	VolumeAttachLimit            int64
	EnablePerfOptimization       bool
	CloudConfigSecretName        string
	CloudConfigSecretNamespace   string
	CustomUserAgent              string
	UserAgentSuffix              string
	UseCSIProxyGAInterface       bool
	EnableDiskOnlineResize       bool
	AllowEmptyCloudConfig        bool
	EnableAsyncAttach            bool
	EnableListVolumes            bool
	EnableListSnapshots          bool
	SupportZone                  bool
	GetNodeInfoFromLabels        bool
	EnableDiskCapacityCheck      bool
	DisableUpdateCache           bool
	EnableTrafficManager         bool
	TrafficManagerPort           int64
	AttachDetachInitialDelayInMs int64
	VMSSCacheTTLInSeconds        int64
	VolStatsCacheExpireInMinutes int64
	VMType                       string
	EnableWindowsHostProcess     bool
	GetNodeIDFromIMDS            bool
	WaitForSnapshotReady         bool
}

DriverOptions defines driver parameters specified in driver deployment

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 *testing.T) (FakeDriver, error)

NewFakeDriver returns a driver implementation suitable for use in unit tests.

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

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.

Jump to

Keyboard shortcuts

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