Documentation
¶
Index ¶
- Constants
- Variables
- func ByteCeilToGib(nByte int64) int
- func EntryFunction(functionName string) (info string, hash string)
- func ExitFunction(functionName, hash string) (info string)
- func FormatAndMount(diskMounter *k8smount.SafeFormatAndMount, source string, target string, ...) error
- func FormatNewDisk(readOnly bool, source, fstype, target string, ...) error
- func GenCsiVolId(volid, serial string) (csivolId string)
- func GenerateHashInEightBytes(input string) string
- func GetDiskFStypePTtype(disk string) (fstype string, pttype string, err error)
- func GetRequestSizeBytes(capRange *csi.CapacityRange) (int64, error)
- func GetZecEnv() (vmid string, vm_zone string, err error)
- func GetZecSecret(akpath string, skpath string) (ak string, pw string, err error)
- func GibToByte(nGib int) int64
- func IsDirEmpty(name string) (bool, error)
- func IsFileExisting(filename string) bool
- func IsValidCapacityBytes(cur int64, capRange *csi.CapacityRange) bool
- func NewSafeMounter() *mount.SafeFormatAndMount
- func ParseCsiVolId(csivolId string) (volid string, serial string, err error)
- func RetryOnError(backoff wait.Backoff, fn func() error) error
- func VerifyEnv() (platform string, err error)
- type ResourceLocks
- type RetryLimiter
Constants ¶
View Source
const ( Kib int64 = 1024 Mib int64 = Kib * 1024 Gib int64 = Mib * 1024 Tib int64 = Gib * 1024 )
View Source
const ( Version string = "v1.0.0" DefaultProvisionName string = "disk.csi.zenlayer.com" NodeDriverType string = "node" ControllerDriverType string = "controller" )
View Source
const ( FileSystemExt3 string = "ext3" FileSystemExt4 string = "ext4" FileSystemXfs string = "xfs" DefaultFileSystem string = FileSystemExt4 )
View Source
const ( ZEC_PLATFORM string = "Zenlayer Elastic Compute" ZEC_SYS_VENDOR_PATH string = "/sys/class/dmi/id/sys_vendor" //Vm platform ZEC_PRODUCT_FAMILY_PATH string = "/sys/class/dmi/id/product_family" //Vm zone ZEC_PRODUCT_SERIAL_PATH string = "/sys/class/dmi/id/product_serial" //Vm console ID )
View Source
const DefaultTimeFormat = "2006-01-02 15:04:05"
View Source
const FEAT_MOUNTOPT_ENABLE = "enable_mount_opt"
View Source
const Int64Max = int64(^uint64(0) >> 1)
View Source
const KubeletRootDir = "/var/lib/kubelet"
View Source
const KubernetesPluginPathPrefix = "/plugins/kubernetes.io/"
View Source
const (
OperationPendingFmt = "already an operation for the specified resource %s"
)
View Source
const ZECVMID_LEN = 19 //zec VmID len example:1455441132925494374
View Source
const ZECVOLID_LEN = 19 //zec DiskId len example:1440908808376556310
View Source
const ZECVOLSERIAL_LEN = 20 //zec Disk Serial len example:d100om84ggf2oqdh05eg
Variables ¶
View Source
var DefaultResourceGroup string
View Source
var DefaultZone string
View Source
var FeatureGates []string
View Source
var MixDriver bool
Functions ¶
func EntryFunction ¶
func ExitFunction ¶
func FormatAndMount ¶
func FormatNewDisk ¶
func GenCsiVolId ¶
func GetDiskFStypePTtype ¶
GetDiskFStypePTtype uses 'blkid' to see if the given disk is unformatted
func GetRequestSizeBytes ¶
func GetRequestSizeBytes(capRange *csi.CapacityRange) (int64, error)
GetRequestSizeBytes get minimal required bytes and not exceed limit bytes.
func GetZecSecret ¶
func IsDirEmpty ¶
IsDirEmpty check whether the given directory is empty
func IsFileExisting ¶
IsFileExisting check file exist in volume driver
func IsValidCapacityBytes ¶
func IsValidCapacityBytes(cur int64, capRange *csi.CapacityRange) bool
Valid capacity bytes in capacity range
func NewSafeMounter ¶
func NewSafeMounter() *mount.SafeFormatAndMount
Types ¶
type ResourceLocks ¶
type ResourceLocks struct {
// contains filtered or unexported fields
}
func NewResourceLocks ¶
func NewResourceLocks() *ResourceLocks
func (*ResourceLocks) Release ¶
func (lock *ResourceLocks) Release(resourceID string)
func (*ResourceLocks) TryAcquire ¶
func (lock *ResourceLocks) TryAcquire(resourceID string) bool
type RetryLimiter ¶
type RetryLimiter interface {
Add(id string)
Try(id string) bool
GetMaxRetryTimes() int
GetCurrentRetryTimes(id string) int
}
func NewRetryLimiter ¶
func NewRetryLimiter(maxRetry int) RetryLimiter
Click to show internal directories.
Click to hide internal directories.