Documentation ¶
Index ¶
- Constants
- Variables
- func ExtractBlockVolumePerformanceLevel(attribute string) (int64, error)
- func ExtractISCSIInformation(attributes map[string]string) (*disk.Disk, error)
- func ExtractISCSIInformationFromMountPath(logger *zap.SugaredLogger, diskPath []string) (*disk.Disk, error)
- func ExtractStorage(capRange *csi.CapacityRange) (int64, error)
- func FormatBytes(inputBytes int64) string
- func GetDevicePath(sd *disk.Disk) string
- func GetKubeClient(logger *zap.SugaredLogger, master, kubeconfig string) *kubernetes.Clientset
- func MaxOfInt(a, b int64) int64
- func RoundUpMinSize() int64
- func RoundUpSize(volumeSizeBytes int64, allocationUnitBytes int64) int64
- func ValidateFsType(logger *zap.SugaredLogger, fsType string) string
- type Util
- func (u *Util) GetAvailableDomainInNodeLabel(fullAD string) string
- func (u *Util) LookupNodeAvailableDomain(k kubernetes.Interface, nodeID string) (string, error)
- func (u *Util) LookupNodeID(k kubernetes.Interface, nodeName string) (string, error)
- func (u *Util) WaitForPathToExist(path string, maxRetries int) bool
- type VolumeLocks
Constants ¶
View Source
const ( // minimumVolumeSizeInBytes is used to validate that the user is not trying // to create a volume that is smaller than what we support MinimumVolumeSizeInBytes int64 = 50 * client.GiB // maximumVolumeSizeInBytes is used to validate that the user is not trying // to create a volume that is larger than what we support MaximumVolumeSizeInBytes int64 = 32 * client.TiB // Block Volume Performance Units VpusPerGB = "vpusPerGB" LowCostPerformanceOption = 0 BalancedPerformanceOption = 10 HigherPerformanceOption = 20 )
Variables ¶
View Source
var ( DiskByPathPatternPV = `/dev/disk/by-path/pci-\d+:\d+:\d+\.\d+-scsi-\d+:\d+:\d+:\d+$` DiskByPathPatternISCSI = `/dev/disk/by-path/ip-[\w\.]+:\d+-iscsi-[\w\.\-:]+-lun-1$` )
Functions ¶
func ExtractBlockVolumePerformanceLevel ¶ added in v1.19.12
Extracts the vpusPerGB as int64 from given string input
func ExtractISCSIInformation ¶
func ExtractStorage ¶
func ExtractStorage(capRange *csi.CapacityRange) (int64, error)
extractStorage extracts the storage size in bytes from the given capacity range. If the capacity range is not satisfied it returns the default volume size. If the capacity range is below or above supported sizes, it returns an error.
func FormatBytes ¶
func GetDevicePath ¶
func GetKubeClient ¶
func GetKubeClient(logger *zap.SugaredLogger, master, kubeconfig string) *kubernetes.Clientset
func RoundUpMinSize ¶
func RoundUpMinSize() int64
func RoundUpSize ¶
func ValidateFsType ¶
func ValidateFsType(logger *zap.SugaredLogger, fsType string) string
Types ¶
type Util ¶
type Util struct {
Logger *zap.SugaredLogger
}
Util interface
func (*Util) GetAvailableDomainInNodeLabel ¶
convert "zkJl:US-ASHBURN-AD-1" to "US-ASHBURN-AD-1"
func (*Util) LookupNodeAvailableDomain ¶
func (*Util) LookupNodeID ¶
type VolumeLocks ¶
type VolumeLocks struct {
// contains filtered or unexported fields
}
func NewVolumeLocks ¶
func NewVolumeLocks() *VolumeLocks
func (*VolumeLocks) Release ¶
func (vl *VolumeLocks) Release(volumeID string)
func (*VolumeLocks) TryAcquire ¶
func (vl *VolumeLocks) TryAcquire(volumeID string) bool
Click to show internal directories.
Click to hide internal directories.