Documentation ¶
Index ¶
- Constants
- Variables
- func CallerWithCondLock[T any](cond *sync.Cond, f func() T) T
- func ContainsIgnoredCase(s []string, k string) bool
- func ForceUmountWithTimeout(path string, timeout time.Duration) error
- func GetFullDevPath(shortPath string) string
- func GetHostNamespacePath(hostProcPath string) string
- func IsFSCorrupted(err error) bool
- func IsHostProcMounted() (bool, error)
- func IsSupportedFileSystem(fsType string) bool
- func MakeExt4DiskFormatting(devPath, uuid string) error
- func MatchesIgnoredCase(s []string, k string) bool
- func MountDisk(devPath, mountPoint string) error
- func UmountDisk(path string) error
- func XMLWriter(targetFilePath string, xmlData any) error
- type Disk
- type Driver
- type Executor
- type Source
- type Target
Constants ¶
const ( DockerdProcess = "dockerd" ContainerdProcess = "containerd" ContainerdProcessShim = "containerd-shim" )
const ( // ProcPath is a vfs storing process info for Linux. ProcPath = "/proc" // HostProcPath is the convention path where host `/proc` is mounted. HostProcPath = "/host/proc" // DiskRemoveTag indicates a Longhorn is pending to remove. DiskRemoveTag = "harvester-ndm-disk-remove" )
const (
NSBinary = "nsenter"
)
Variables ¶
var CmdTimeoutError error
Functions ¶
func CallerWithCondLock ¶
CallerWithLock is a helper function to call a function with a condition lock
func ContainsIgnoredCase ¶
ContainsIgnoredCase checks if the item of string slice contains the key with case-insensitive
func ForceUmountWithTimeout ¶ added in v0.6.3
ForceUmountWithTimeout umounts the specific device with timeout to the specified path
func GetFullDevPath ¶
GetFullDevPath will return full path with `/dev/` prefix
func GetHostNamespacePath ¶ added in v0.6.3
func IsFSCorrupted ¶
IsFSCorrupted checks if the error is caused by a corrupted filesystem
func IsHostProcMounted ¶
IsHostProcMounted checks if host's proc info `/proc` is mounted on `/host/proc`
func IsSupportedFileSystem ¶
IsSupportedFileSystem checks if the filesystem type is supported
func MakeExt4DiskFormatting ¶
MakeExt4DiskFormatting formats the specified volume device to ext4 with the specified UUID return error if failed
func MatchesIgnoredCase ¶
MatchesIgnoredCase checks if the item of string slice fully match the key with case-insensitive
func UmountDisk ¶
UmountDisk unmounts the specified volume device to the specified path
Types ¶
type Disk ¶ added in v0.5.3
type Disk struct { XMLName xml.Name `xml:"disk"` Type string `xml:"type,attr"` Device string `xml:"device,attr"` Driver Driver `xml:"driver"` Source Source `xml:"source"` Target Target `xml:"target"` WWN string `xml:"wwn"` VENDOR string `xml:"vendor"` }
func DiskXMLReader ¶ added in v0.5.3
DiskXMLReader can read the libvirt disk xml file and return a Disk struct
type Executor ¶ added in v0.6.3
type Executor struct {
// contains filtered or unexported fields
}
func NewExecutor ¶ added in v0.6.3
func NewExecutor() *Executor