Documentation ¶
Index ¶
- Constants
- Variables
- func AddFinalizer(name string, obj runtime.Object) error
- func AutoCorrectName(name string, maxLength int) string
- func Backoff(maxDuration time.Duration, timeoutMessage string, f func() (bool, error)) error
- func CheckBackupType(backupTarget string) (string, error)
- func CmdOutLines(cmd *exec.Cmd, cancel <-chan interface{}) (<-chan string, <-chan error)
- func Contains(list []string, item string) bool
- func ConvertSize(size interface{}) (int64, error)
- func CopyHostDirectoryContent(src, dest string) (err error)
- func CopyReq(req *http.Request) *http.Request
- func CreateDiskPathReplicaSubdirectory(path string) error
- func DeleteDiskPathReplicaSubdirectoryAndDiskCfgFile(nsExec *iscsi_util.NamespaceExecutor, path string) error
- func DetectFileSystem(volumeName string) (string, error)
- func Execute(envs []string, binary string, args ...string) (string, error)
- func ExecuteWithTimeout(timeout time.Duration, envs []string, binary string, args ...string) (string, error)
- func ExecuteWithoutTimeout(envs []string, binary string, args ...string) (string, error)
- func ExpandFileSystem(volumeName string) (err error)
- func FilteredLoggingHandler(filteredPaths map[string]struct{}, writer io.Writer, router http.Handler) http.Handler
- func FinalizerExists(name string, obj runtime.Object) bool
- func FormatLocalTime(t time.Time, loc *time.Location) string
- func FormatTimeZ(t time.Time) string
- func FromMillis(t int64) time.Time
- func GetAnnotation(obj runtime.Object, annotationKey string) (string, error)
- func GetBackupID(backupURL string) (string, error)
- func GetChecksumSHA512(data []byte) string
- func GetDistinctTolerations(tolerationList []v1.Toleration) []v1.Toleration
- func GetLocalIPs() ([]string, error)
- func GetRequiredEnv(key string) (string, error)
- func GetSortedKeysFromMap(maps interface{}) []string
- func GetStringChecksum(data string) string
- func GetStringHash(data string) string
- func GetTolerationChecksum(t v1.Toleration) string
- func IsKubernetesDefaultToleration(toleration v1.Toleration) bool
- func IsKubernetesVersionAtLeast(kubeClient clientset.Interface, vers string) (bool, error)
- func IsSupportedFileSystem(fsType string) bool
- func LimitToPeriod(p, t [2]time.Time) [2]time.Time
- func MinInt(a, b int) int
- func Now() string
- func ParseLabels(labels []string) (map[string]string, error)
- func ParseLocalTime(ts string, loc *time.Location) (time.Time, error)
- func ParsePeriod(s string, loc *time.Location) ([2]time.Time, error)
- func ParseTime(t string) (time.Time, error)
- func ParseTimeZ(s string) (time.Time, error)
- func RandomID() string
- func RegisterShutdownChannel(done chan struct{})
- func RemoveFinalizer(name string, obj runtime.Object) error
- func RemoveHostDirectoryContent(directory string) (err error)
- func RetryOnConflictCause(fn func() (interface{}, error)) (interface{}, error)
- func RetryOnErrorCondition(fn func() (interface{}, error), predicate func(error) bool) (interface{}, error)
- func RetryOnNotFoundCause(fn func() (interface{}, error)) (interface{}, error)
- func RoundUpSize(size int64) int64
- func RunAsync(wg *sync.WaitGroup, f func())
- func SetAnnotation(obj runtime.Object, annotationKey, annotationValue string) error
- func SplitStringToMap(str, separator string) map[string]struct{}
- func TimestampAfterTimeout(ts string, timeout time.Duration) bool
- func TimestampWithinLimit(latest time.Time, ts string, limit time.Duration) bool
- func TolerationListToMap(tolerationList []v1.Toleration) map[string]v1.Toleration
- func UUID() string
- func ValidateName(name string) bool
- func ValidateSnapshotLabels(labels map[string]string) (map[string]string, error)
- func ValidateTags(inputTags []string) ([]string, error)
- func WaitForAPI(url string, timeout int) error
- func WaitForDevice(dev string, timeout int) error
- type DiskConfig
- type DiskInfo
- type MetadataConfig
Constants ¶
View Source
const ( VolumeStackPrefix = "volume-" ControllerServiceName = "controller" ReplicaServiceName = "replica" HostProcPath = "/host/proc" ReplicaDirectory = "/replicas/" DeviceDirectory = "/dev/longhorn/" TemporaryMountPointDirectory = "/tmp/mnt/" DefaultKubernetesTolerationKey = "kubernetes.io" DiskConfigFile = "longhorn-disk.cfg" SizeAlignment = 2 * 1024 * 1024 MinimalVolumeSize = 10 * 1024 * 1024 )
Variables ¶
View Source
var ( APIRetryInterval = 500 * time.Millisecond APIRetryJitterInterval = 50 * time.Millisecond APIRetryCounts = 10 )
Functions ¶
func AutoCorrectName ¶
AutoCorrectName converts name to lowercase, and correct overlength name by replaces the name suffix with 8 char from its checksum to ensure uniquenedoss.
func CheckBackupType ¶
func CmdOutLines ¶
func ConvertSize ¶
func DeleteDiskPathReplicaSubdirectoryAndDiskCfgFile ¶
func DeleteDiskPathReplicaSubdirectoryAndDiskCfgFile( nsExec *iscsi_util.NamespaceExecutor, path string) error
func DetectFileSystem ¶
func ExecuteWithTimeout ¶
func ExecuteWithoutTimeout ¶
func ExpandFileSystem ¶
func FilteredLoggingHandler ¶
func FormatTimeZ ¶
func FromMillis ¶
func GetBackupID ¶
func GetChecksumSHA512 ¶
func GetDistinctTolerations ¶
func GetDistinctTolerations(tolerationList []v1.Toleration) []v1.Toleration
func GetLocalIPs ¶
func GetRequiredEnv ¶
func GetSortedKeysFromMap ¶
func GetSortedKeysFromMap(maps interface{}) []string
func GetStringChecksum ¶
func GetStringHash ¶
func GetTolerationChecksum ¶
func GetTolerationChecksum(t v1.Toleration) string
func IsKubernetesDefaultToleration ¶
func IsKubernetesDefaultToleration(toleration v1.Toleration) bool
func IsSupportedFileSystem ¶
func ParseLabels ¶
ParseLabels parses the provided Labels based on longhorn-engine's implementation: https://github.com/longhorn/longhorn-engine/blob/master/util/util.go
func RegisterShutdownChannel ¶
func RegisterShutdownChannel(done chan struct{})
func RetryOnConflictCause ¶
func RetryOnErrorCondition ¶
func RetryOnNotFoundCause ¶
func RoundUpSize ¶
func SetAnnotation ¶
func SplitStringToMap ¶
func TimestampWithinLimit ¶
func TolerationListToMap ¶
func TolerationListToMap(tolerationList []v1.Toleration) map[string]v1.Toleration
func ValidateName ¶
func ValidateSnapshotLabels ¶
func ValidateTags ¶
func WaitForDevice ¶
WaitForDevice timeout in second
Types ¶
type DiskConfig ¶
type DiskConfig struct {
DiskUUID string `json:"diskUUID"`
}
func GenerateDiskConfig ¶
func GenerateDiskConfig(path string) (*DiskConfig, error)
func GetDiskConfig ¶
func GetDiskConfig(path string) (*DiskConfig, error)
Click to show internal directories.
Click to hide internal directories.