Documentation
¶
Index ¶
- Constants
- func CreateDir(target string, mode int) error
- func FileExisted(filename string) bool
- func FsInfo(path string) (int64, int64, int64, int64, int64, int64, error)
- func GetMetrics(path string) (*csi.NodeGetVolumeStatsResponse, error)
- func IsDir(path string) bool
- func Mounted(mountPath string) bool
- func ReadCloudInitInfo() (string, error)
- func RunCommand(cmd string) (string, error)
- func RunSYSCommand(cmd string) error
- func SentrySendError(errorInfo error)
- func ServerReachable(host, port string, timeout time.Duration) bool
- func Unmount(mountPath string) error
- func WaitTimeout(wg *sync.WaitGroup, timeout int) bool
- type Metrics
- type NodeMeta
- type VolumeLocks
Constants ¶
View Source
const ( // VolumeOperationAlreadyExistsFmt string format to return for concurrent operation. VolumeOperationAlreadyExistsFmt = "an operation with the given Volume ID %s already exists" // SnapshotOperationAlreadyExistsFmt string format to return for concurrent operation. SnapshotOperationAlreadyExistsFmt = "an operation with the given Snapshot ID %s already exists" )
View Source
const ( NodeMetaDataFile = "/host/etc/cds/node-meta" CloudInitDevSize = 8 * 1024 SockFile = "/var/run/oss-server.sock" )
Variables ¶
This section is empty.
Functions ¶
func FileExisted ¶
FileExisted checks if a file or directory exists
func FsInfo ¶
FSInfo linux returns (available bytes, byte capacity, byte usage, total inodes, inodes free, inode usage, error) for the filesystem that path resides upon.
func GetMetrics ¶
func GetMetrics(path string) (*csi.NodeGetVolumeStatsResponse, error)
GetMetrics get path metric
func ReadCloudInitInfo ¶
func RunSYSCommand ¶
func SentrySendError ¶ added in v1.4.0
func SentrySendError(errorInfo error)
func ServerReachable ¶
ServerReachable tests whether a server is connection using TCP
Types ¶
type Metrics ¶
type Metrics struct { // The time at which these stats were updated. Time metav1.Time // Used represents the total bytes used by the Volume. // Note: For block devices this maybe more than the total size of the files. Used *resource.Quantity // Capacity represents the total capacity (bytes) of the volume's // underlying storage. For Volumes that share a filesystem with the host // (e.g. emptydir, hostpath) this is the size of the underlying storage, // and will not equal Used + Available as the fs is shared. Capacity *resource.Quantity // Available represents the storage space available (bytes) for the // Volume. For Volumes that share a filesystem with the host (e.g. // emptydir, hostpath), this is the available space on the underlying // storage, and is shared with host processes and other Volumes. Available *resource.Quantity // InodesUsed represents the total inodes used by the Volume. InodesUsed *resource.Quantity // Inodes represents the total number of inodes available in the volume. // For volumes that share a filesystem with the host (e.g. emptydir, hostpath), // this is the inodes available in the underlying storage, // and will not equal InodesUsed + InodesFree as the fs is shared. Inodes *resource.Quantity // InodesFree represent the inodes available for the volume. For Volumes that share // a filesystem with the host (e.g. emptydir, hostpath), this is the free inodes // on the underlying storage, and is shared with host processes and other volumes InodesFree *resource.Quantity }
Metrics represents the used and available bytes of the Volume.
type VolumeLocks ¶
type VolumeLocks struct {
// contains filtered or unexported fields
}
VolumeLocks implements a map with atomic operations. It stores a set of all volume IDs with an ongoing operation.
func (*VolumeLocks) Release ¶
func (vl *VolumeLocks) Release(volumeID string)
Release deletes the lock on volumeID.
func (*VolumeLocks) TryAcquire ¶
func (vl *VolumeLocks) TryAcquire(volumeID string) bool
TryAcquire tries to acquire the lock for operating on volumeID and returns true if successful. If another operation is already using volumeID, returns false.
Click to show internal directories.
Click to hide internal directories.