Documentation ¶
Index ¶
- Constants
- func CleanupMountPoint(m *mount.SafeFormatAndMount, target string, extensiveMountCheck bool) error
- func ConvertTagsToMap(tags string) (map[string]string, error)
- func GetFileShareInfo(id string) (string, string, string, string, string, string, error)
- func GetUserAgent(driverName, customUserAgent, userAgentSuffix string) string
- func GetVersionYAML(driverName string) (string, error)
- func IsCorruptedDir(dir string) bool
- func NewFakeMounter() (*mount.SafeFormatAndMount, error)
- func SMBMount(m *mount.SafeFormatAndMount, source, target, fsType string, ...) error
- func SetVolumeOwnership(path, gid, policy string) error
- type Driver
- func (d *Driver) ControllerExpandVolume(ctx context.Context, req *csi.ControllerExpandVolumeRequest) (*csi.ControllerExpandVolumeResponse, error)
- func (d *Driver) ControllerGetCapabilities(ctx context.Context, req *csi.ControllerGetCapabilitiesRequest) (*csi.ControllerGetCapabilitiesResponse, error)
- func (d *Driver) ControllerGetVolume(context.Context, *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) CreateFileShare(ctx context.Context, accountOptions *azure.AccountOptions, ...) 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) DeleteFileShare(ctx context.Context, subsID, resourceGroup, accountName, shareName string, ...) 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) GetAccountInfo(ctx context.Context, volumeID string, secrets, reqContext map[string]string) (string, string, string, string, string, string, error)
- func (d *Driver) GetCapacity(ctx context.Context, req *csi.GetCapacityRequest) (*csi.GetCapacityResponse, error)
- func (f *Driver) GetPluginCapabilities(ctx context.Context, req *csi.GetPluginCapabilitiesRequest) (*csi.GetPluginCapabilitiesResponse, error)
- func (f *Driver) GetPluginInfo(ctx context.Context, req *csi.GetPluginInfoRequest) (*csi.GetPluginInfoResponse, error)
- func (d *Driver) GetStorageAccesskey(ctx context.Context, accountOptions *azure.AccountOptions, ...) (string, error)
- func (d *Driver) GetStorageAccountFromSecret(ctx context.Context, secretName, secretNamespace string) (string, string, error)
- func (d *Driver) GetTotalAccountQuota(ctx context.Context, subsID, resourceGroup, accountName string) (int32, 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(ctx context.Context, req *csi.NodeExpandVolumeRequest) (*csi.NodeExpandVolumeResponse, error)
- func (d *Driver) NodeGetCapabilities(ctx context.Context, req *csi.NodeGetCapabilitiesRequest) (*csi.NodeGetCapabilitiesResponse, error)
- func (d *Driver) NodeGetInfo(ctx context.Context, req *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 (f *Driver) Probe(ctx context.Context, req *csi.ProbeRequest) (*csi.ProbeResponse, error)
- func (d *Driver) RemoveStorageAccountTag(ctx context.Context, subsID, resourceGroup, account, key string) error
- func (d *Driver) ResizeFileShare(ctx context.Context, subsID, resourceGroup, accountName, shareName string, ...) error
- func (d *Driver) Run(endpoint, kubeconfig string, testBool bool)
- func (d *Driver) SetAzureCredentials(ctx context.Context, ...) (string, error)
- func (d *Driver) ValidateVolumeCapabilities(ctx context.Context, req *csi.ValidateVolumeCapabilitiesRequest) (*csi.ValidateVolumeCapabilitiesResponse, error)
- type DriverOptions
- type VersionInfo
- type VolumeMounter
- func (l *VolumeMounter) CanMount() error
- func (l *VolumeMounter) GetAttributes() volume.Attributes
- func (l *VolumeMounter) GetMetrics() (*volume.Metrics, error)
- func (l *VolumeMounter) GetPath() string
- func (l *VolumeMounter) SetUp(mounterArgs volume.MounterArgs) error
- func (l *VolumeMounter) SetUpAt(dir string, mounterArgs volume.MounterArgs) error
Constants ¶
const ( DefaultAzureCredentialFileEnv = "AZURE_CREDENTIAL_FILE" DefaultCredFilePathLinux = "/etc/kubernetes/azure.json" DefaultCredFilePathWindows = "C:\\k\\azure.json" )
const ( DefaultDriverName = "file.csi.azure.com" VolumeID = "volumeid" SourceResourceID = "source_resource_id" SnapshotName = "snapshot_name" SnapshotID = "snapshot_id" FSGroupChangeNone = "None" )
Variables ¶
This section is empty.
Functions ¶
func CleanupMountPoint ¶ added in v0.6.0
func CleanupMountPoint(m *mount.SafeFormatAndMount, target string, extensiveMountCheck bool) error
func ConvertTagsToMap ¶ added in v1.2.0
func GetFileShareInfo ¶ added in v0.8.0
get file share info according to volume id, e.g. input: "rg#f5713de20cde511e8ba4900#fileShareName#diskname.vhd#uuid#namespace#subsID" output: rg, f5713de20cde511e8ba4900, fileShareName, diskname.vhd, namespace, subsID
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 IsCorruptedDir ¶ added in v0.5.0
func NewFakeMounter ¶ added in v1.0.0
func NewFakeMounter() (*mount.SafeFormatAndMount, error)
NewFakeMounter fake mounter
func SMBMount ¶ added in v0.6.0
func SMBMount(m *mount.SafeFormatAndMount, source, target, fsType string, options, sensitiveMountOptions []string) error
func SetVolumeOwnership ¶ added in v1.7.0
SetVolumeOwnership would set gid for path recursively
Types ¶
type Driver ¶
Driver implements all interfaces of CSI drivers
func NewDriver ¶
func NewDriver(options *DriverOptions) *Driver
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.
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(ctx context.Context, req *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) ControllerPublishVolume ¶
func (d *Driver) ControllerPublishVolume(ctx context.Context, req *csi.ControllerPublishVolumeRequest) (*csi.ControllerPublishVolumeResponse, error)
ControllerPublishVolume make a volume available on some required node
func (*Driver) ControllerUnpublishVolume ¶
func (d *Driver) ControllerUnpublishVolume(ctx context.Context, req *csi.ControllerUnpublishVolumeRequest) (*csi.ControllerUnpublishVolumeResponse, error)
ControllerUnpublishVolume detach the volume on a specified node
func (*Driver) CreateFileShare ¶ added in v0.9.0
func (d *Driver) CreateFileShare(ctx context.Context, accountOptions *azure.AccountOptions, shareOptions *fileclient.ShareOptions, secrets map[string]string) error
CreateFileShare creates a file share
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 file
func (*Driver) DeleteFileShare ¶ added in v0.9.0
func (d *Driver) DeleteFileShare(ctx context.Context, subsID, resourceGroup, accountName, shareName string, secrets map[string]string) error
DeleteFileShare deletes a file share using storage account name and key
func (*Driver) DeleteSnapshot ¶
func (d *Driver) DeleteSnapshot(ctx context.Context, req *csi.DeleteSnapshotRequest) (*csi.DeleteSnapshotResponse, error)
DeleteSnapshot delete a snapshot (todo)
func (*Driver) DeleteVolume ¶
func (d *Driver) DeleteVolume(ctx context.Context, req *csi.DeleteVolumeRequest) (*csi.DeleteVolumeResponse, error)
DeleteVolume delete an azure file
func (*Driver) GetAccountInfo ¶ added in v0.7.0
func (d *Driver) GetAccountInfo(ctx context.Context, volumeID string, secrets, reqContext map[string]string) (string, string, string, string, string, string, error)
GetAccountInfo get account info return <rgName, accountName, accountKey, fileShareName, diskName, subsID, err>
func (*Driver) GetCapacity ¶
func (d *Driver) GetCapacity(ctx context.Context, req *csi.GetCapacityRequest) (*csi.GetCapacityResponse, error)
GetCapacity returns the capacity of the total available storage pool
func (*Driver) GetPluginCapabilities ¶
func (f *Driver) GetPluginCapabilities(ctx context.Context, req *csi.GetPluginCapabilitiesRequest) (*csi.GetPluginCapabilitiesResponse, error)
GetPluginCapabilities returns the capabilities of the plugin
func (*Driver) GetPluginInfo ¶
func (f *Driver) GetPluginInfo(ctx context.Context, req *csi.GetPluginInfoRequest) (*csi.GetPluginInfoResponse, error)
GetPluginInfo return the version and name of the plugin
func (*Driver) GetStorageAccesskey ¶ added in v0.10.0
func (d *Driver) GetStorageAccesskey(ctx context.Context, accountOptions *azure.AccountOptions, secrets map[string]string, secretName, secretNamespace string) (string, error)
GetStorageAccesskey get Azure storage account key from
- secrets (if not empty)
- use k8s client identity to read from k8s secret
- use cluster identity to get from storage account directly
func (*Driver) GetStorageAccountFromSecret ¶ added in v1.3.0
func (d *Driver) GetStorageAccountFromSecret(ctx context.Context, secretName, secretNamespace string) (string, string, error)
GetStorageAccountFromSecret get storage account key from k8s secret return <accountName, accountKey, error>
func (*Driver) GetTotalAccountQuota ¶ added in v1.24.6
func (d *Driver) GetTotalAccountQuota(ctx context.Context, subsID, resourceGroup, accountName string) (int32, int32, error)
GetTotalAccountQuota returns the total quota in GB of all file shares in the storage account and the number of file shares
func (*Driver) ListSnapshots ¶
func (d *Driver) ListSnapshots(ctx context.Context, req *csi.ListSnapshotsRequest) (*csi.ListSnapshotsResponse, error)
ListSnapshots list all snapshots (todo)
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(ctx context.Context, req *csi.NodeExpandVolumeRequest) (*csi.NodeExpandVolumeResponse, error)
NodeExpandVolume node expand volume N/A for azure file
func (*Driver) NodeGetCapabilities ¶
func (d *Driver) NodeGetCapabilities(ctx context.Context, req *csi.NodeGetCapabilitiesRequest) (*csi.NodeGetCapabilitiesResponse, error)
NodeGetCapabilities return the capabilities of the Node plugin
func (*Driver) NodeGetInfo ¶
func (d *Driver) NodeGetInfo(ctx context.Context, req *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)
NodeGetVolumeStats get volume stats
func (*Driver) NodePublishVolume ¶
func (d *Driver) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error)
NodePublishVolume mount the volume from staging to target path
func (*Driver) NodeStageVolume ¶
func (d *Driver) NodeStageVolume(ctx context.Context, req *csi.NodeStageVolumeRequest) (*csi.NodeStageVolumeResponse, error)
NodeStageVolume mount the volume to a staging path
func (*Driver) NodeUnpublishVolume ¶
func (d *Driver) NodeUnpublishVolume(ctx context.Context, req *csi.NodeUnpublishVolumeRequest) (*csi.NodeUnpublishVolumeResponse, error)
NodeUnpublishVolume unmount the volume from the target path
func (*Driver) NodeUnstageVolume ¶
func (d *Driver) NodeUnstageVolume(ctx context.Context, req *csi.NodeUnstageVolumeRequest) (*csi.NodeUnstageVolumeResponse, error)
NodeUnstageVolume unmount the volume from the staging path
func (*Driver) Probe ¶
func (f *Driver) Probe(ctx context.Context, req *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) RemoveStorageAccountTag ¶ added in v1.1.0
func (d *Driver) RemoveStorageAccountTag(ctx context.Context, subsID, resourceGroup, account, key string) error
RemoveStorageAccountTag remove tag from storage account
func (*Driver) ResizeFileShare ¶ added in v0.9.0
func (d *Driver) ResizeFileShare(ctx context.Context, subsID, resourceGroup, accountName, shareName string, sizeGiB int, secrets map[string]string) error
ResizeFileShare resizes a file share
func (*Driver) SetAzureCredentials ¶ added in v1.2.0
func (*Driver) ValidateVolumeCapabilities ¶
func (d *Driver) ValidateVolumeCapabilities(ctx context.Context, req *csi.ValidateVolumeCapabilitiesRequest) (*csi.ValidateVolumeCapabilitiesResponse, error)
ValidateVolumeCapabilities return the capabilities of the volume
type DriverOptions ¶ added in v1.5.0
type DriverOptions struct { NodeID string DriverName string CloudConfigSecretName string CloudConfigSecretNamespace string CustomUserAgent string UserAgentSuffix string AllowEmptyCloudConfig bool AllowInlineVolumeKeyAccessWithIdentity bool EnableVHDDiskFeature bool EnableGetVolumeStats bool AppendMountErrorHelpLink bool MountPermissions uint64 FSGroupChangePolicy string KubeAPIQPS float64 KubeAPIBurst int EnableWindowsHostProcess bool AppendClosetimeoOption bool }
DriverOptions defines driver parameters specified in driver deployment
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 VolumeMounter ¶ added in v1.7.0
type VolumeMounter struct {
// contains filtered or unexported fields
}
func (*VolumeMounter) CanMount ¶ added in v1.7.0
func (l *VolumeMounter) CanMount() error
func (*VolumeMounter) GetAttributes ¶ added in v1.7.0
func (l *VolumeMounter) GetAttributes() volume.Attributes
func (*VolumeMounter) GetMetrics ¶ added in v1.7.0
func (l *VolumeMounter) GetMetrics() (*volume.Metrics, error)
func (*VolumeMounter) GetPath ¶ added in v1.7.0
func (l *VolumeMounter) GetPath() string
func (*VolumeMounter) SetUp ¶ added in v1.7.0
func (l *VolumeMounter) SetUp(mounterArgs volume.MounterArgs) error
func (*VolumeMounter) SetUpAt ¶ added in v1.7.0
func (l *VolumeMounter) SetUpAt(dir string, mounterArgs volume.MounterArgs) error