blob

package
v1.21.5 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2023 License: Apache-2.0 Imports: 48 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultDriverName holds the name of the csi-driver
	DefaultDriverName = "blob.csi.azure.com"

	Fuse  = "fuse"
	Fuse2 = "fuse2"
	NFS   = "nfs"

	VolumeID = "volumeid"
)

Variables

View Source
var (
	DefaultAzureCredentialFileEnv = "AZURE_CREDENTIAL_FILE"
	DefaultCredFilePath           = "/etc/kubernetes/azure.json"
)

Functions

func GetContainerInfo

func GetContainerInfo(id string) (string, string, string, string, string, error)

GetContainerInfo get container info according to volume id the format of VolumeId is: rg#accountName#containerName#uuid#secretNamespace#subsID

e.g. input: "rg#f5713de20cde511e8ba4900#containerName#uuid#" output: rg, f5713de20cde511e8ba4900, containerName, "" , "" input: "rg#f5713de20cde511e8ba4900#containerName#uuid#namespace#" output: rg, f5713de20cde511e8ba4900, containerName, namespace, "" input: "rg#f5713de20cde511e8ba4900#containerName#uuid#namespace#subsID" output: rg, f5713de20cde511e8ba4900, containerName, namespace, subsID

func GetUserAgent added in v1.5.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

func IsAzureStackCloud added in v0.11.0

func IsAzureStackCloud(cloud *azure.Cloud) bool

IsAzureStackCloud decides whether the driver is running on Azure Stack Cloud.

func IsCorruptedDir

func IsCorruptedDir(dir string) bool

Types

type Driver

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

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

ControllerExpandVolume controller expand volume

func (*Driver) ControllerGetCapabilities

ControllerGetCapabilities returns the capabilities of the Controller plugin

func (*Driver) ControllerGetVolume added in v0.11.0

ControllerGetVolume get volume

func (*Driver) CreateBlobContainer added in v1.13.0

func (d *Driver) CreateBlobContainer(ctx context.Context, subsID, resourceGroupName, accountName, containerName string, secrets map[string]string) error

CreateBlobContainer creates a blob container

func (*Driver) CreateSnapshot

CreateSnapshot create snapshot

func (*Driver) CreateVolume

func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest) (*csi.CreateVolumeResponse, error)

CreateVolume provisions a volume

func (*Driver) DeleteBlobContainer added in v1.13.0

func (d *Driver) DeleteBlobContainer(ctx context.Context, subsID, resourceGroupName, accountName, containerName string, secrets map[string]string) error

DeleteBlobContainer deletes a blob container

func (*Driver) DeleteSnapshot

DeleteSnapshot delete snapshot

func (*Driver) DeleteVolume

func (d *Driver) DeleteVolume(ctx context.Context, req *csi.DeleteVolumeRequest) (*csi.DeleteVolumeResponse, error)

DeleteVolume delete a volume

func (*Driver) GetAuthEnv

func (d *Driver) GetAuthEnv(ctx context.Context, volumeID, protocol string, attrib, secrets map[string]string) (string, string, string, string, []string, error)

GetAuthEnv return <accountName, containerName, authEnv, error>

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) GetInfoFromSecret added in v1.20.2

func (d *Driver) GetInfoFromSecret(ctx context.Context, secretName, secretNamespace string) (string, string, string, string, string, string, string, error)

GetInfoFromSecret get info from k8s secret return <accountName, accountKey, accountSasToken, msiSecret, spnClientSecret, spnClientID, spnTenantID, error>

func (*Driver) GetPluginCapabilities

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.9.0

func (d *Driver) GetStorageAccesskey(ctx context.Context, accountOptions *azure.AccountOptions, secrets map[string]string, secretName, secretNamespace string) (string, string, error)

GetStorageAccesskey get Azure storage account key from

  1. secrets (if not empty)
  2. use k8s client identity to read from k8s secret
  3. use cluster identity to get from storage account directly

func (*Driver) GetStorageAccountAndContainer

func (d *Driver) GetStorageAccountAndContainer(ctx context.Context, volumeID string, attrib, secrets map[string]string) (string, string, string, string, error)

GetStorageAccountAndContainer get storage account and container info returns <accountName, accountKey, accountSasToken, containerName> only for e2e testing

func (*Driver) ListSnapshots

func (d *Driver) ListSnapshots(ctx context.Context, req *csi.ListSnapshotsRequest) (*csi.ListSnapshotsResponse, error)

ListSnapshots list 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

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

NodeGetVolumeStats get volume stats

func (*Driver) NodePublishVolume

NodePublishVolume mount the volume from staging to target path

func (*Driver) NodeStageVolume

NodeStageVolume mount the volume to a staging path

func (*Driver) NodeUnpublishVolume

NodeUnpublishVolume unmount the volume from the target path

func (*Driver) NodeUnstageVolume

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

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

Run driver initialization

func (*Driver) ValidateVolumeCapabilities

ValidateVolumeCapabilities return the capabilities of the volume

type DriverOptions added in v1.4.0

type DriverOptions struct {
	NodeID                                 string
	DriverName                             string
	CloudConfigSecretName                  string
	CloudConfigSecretNamespace             string
	CustomUserAgent                        string
	UserAgentSuffix                        string
	BlobfuseProxyEndpoint                  string
	EnableBlobfuseProxy                    bool
	BlobfuseProxyConnTimout                int
	EnableBlobMockMount                    bool
	AllowEmptyCloudConfig                  bool
	AllowInlineVolumeKeyAccessWithIdentity bool
	EnableGetVolumeStats                   bool
	AppendTimeStampInCacheDir              bool
	AppendMountErrorHelpLink               bool
	MountPermissions                       uint64
	KubeAPIQPS                             float64
	KubeAPIBurst                           int
	VolStatsCacheExpireInMinutes           int
}

DriverOptions defines driver parameters specified in driver deployment

type MountClient added in v1.1.0

type MountClient struct {
	// contains filtered or unexported fields
}

func NewMountClient added in v1.1.0

func NewMountClient(cc *grpc.ClientConn) *MountClient

NewMountClient returns a new mount client

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

Jump to

Keyboard shortcuts

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