Documentation
¶
Index ¶
- func CheckMountPointOptions(mp *nodelocalstorage.MountPoint) bool
- func ContainInlineVolumes(pod *corev1.Pod) (contain bool, node string)
- func ContainsProvisioner(name string) bool
- func ContainsSnapshotPVC(claims []*corev1.PersistentVolumeClaim) (contain bool)
- func ContainsString(s []string, e string) bool
- func Format(source, fsType string) error
- func GetAddedAndRemovedItems(newList, oldList []string) (addedItems, unchangedItems, removedItems []string)
- func GetDeviceNameFromCsiPV(pv *corev1.PersistentVolume) string
- func GetInlineVolumeInfoFromParam(attributes map[string]string) (vgName string, size int64)
- func GetMediaTypeFromPVC(pvc *corev1.PersistentVolumeClaim, p storagev1informers.Interface) localtype.MediaType
- func GetMetrics(path string) (*csilib.NodeGetVolumeStatsResponse, error)
- func GetMountPointFromCsiPV(pv *corev1.PersistentVolume) string
- func GetPVCRequested(pvc *corev1.PersistentVolumeClaim) int64
- func GetPVFromBoundPVC(pvc *corev1.PersistentVolumeClaim) (name string)
- func GetPVSize(pv *corev1.PersistentVolume) int64
- func GetPVStorageSize(pv *corev1.PersistentVolume) int64
- func GetStorageClassFromPV(pv *corev1.PersistentVolume, p storagev1informers.Interface) *storagev1.StorageClass
- func GetStorageClassFromPVC(pvc *corev1.PersistentVolumeClaim, p storagev1informers.Interface) *storagev1.StorageClass
- func GetVGNameFromCsiPV(pv *corev1.PersistentVolume) string
- func GetVGNameFromPVC(pvc *corev1.PersistentVolumeClaim, p storagev1informers.Interface) string
- func GetVGRequested(localPVs map[string]corev1.PersistentVolume, vgName string) (requested int64)
- func HashSpec(storage *nodelocalstorage.NodeLocalStorage) uint64
- func HashStorageSpec(obj interface{}) uint64
- func HashWithoutState(storage *nodelocalstorage.NodeLocalStorage) uint64
- func HttpJSON(w http.ResponseWriter, code int, result interface{})
- func HttpResponse(w http.ResponseWriter, code int, msg []byte)
- func IsDirEmpty(name string) (bool, error)
- func IsEmpty(r string) bool
- func IsFormatted(source string) (bool, error)
- func IsLocalPV(pv *corev1.PersistentVolume) (isLocalPV bool, node string)
- func IsLocalPVC(claim *corev1.PersistentVolumeClaim, p storagev1informers.Interface, ...) (bool, localtype.VolumeType)
- func IsLocalSnapshotPVC(claim *corev1.PersistentVolumeClaim) bool
- func IsMounted(mountPath string) bool
- func IsOpenLocalPV(pv *corev1.PersistentVolume, p storagev1informers.Interface, ...) (bool, localtype.VolumeType)
- func IsSnapshotPVC(claim *corev1.PersistentVolumeClaim) bool
- func LocalPVType(sc *storagev1.StorageClass) localtype.VolumeType
- func NeedSkip(args schedulerapi.ExtenderArgs) bool
- func PVCName(storageObj interface{}) string
- func PodName(pod *corev1.Pod) string
- func PodPvcAllowReschedule(pvcs []*corev1.PersistentVolumeClaim, fakeNow *time.Time) bool
- func PvcContainsSelectedNode(pvc *corev1.PersistentVolumeClaim) bool
- func Run(cmd string) (string, error)
- func SliceEquals(src interface{}, dst interface{}) bool
- func StringsContains(array []string, val string) (index int)
- func WordSepNormalizeFunc(f *pflag.FlagSet, name string) pflag.NormalizedName
- type CommandRunFunc
- type Mounter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckMountPointOptions ¶
func CheckMountPointOptions(mp *nodelocalstorage.MountPoint) bool
CheckDiskOptions excludes mp which is readyonly or with unsupported fs type
func ContainInlineVolumes ¶ added in v0.5.0
func ContainsProvisioner ¶
func ContainsSnapshotPVC ¶
func ContainsSnapshotPVC(claims []*corev1.PersistentVolumeClaim) (contain bool)
func GetAddedAndRemovedItems ¶
func GetDeviceNameFromCsiPV ¶
func GetDeviceNameFromCsiPV(pv *corev1.PersistentVolume) string
GetDeviceNameFromCsiPV extracts Device Name from open-local csi PV via VolumeAttributes
func GetInlineVolumeInfoFromParam ¶ added in v0.5.0
func GetMediaTypeFromPVC ¶
func GetMediaTypeFromPVC(pvc *corev1.PersistentVolumeClaim, p storagev1informers.Interface) localtype.MediaType
func GetMetrics ¶
func GetMetrics(path string) (*csilib.NodeGetVolumeStatsResponse, error)
GetMetrics get path metric
func GetMountPointFromCsiPV ¶
func GetMountPointFromCsiPV(pv *corev1.PersistentVolume) string
GetMountPointFromCsiPV extracts MountPoint from open-local csi PV via VolumeAttributes
func GetPVCRequested ¶
func GetPVCRequested(pvc *corev1.PersistentVolumeClaim) int64
func GetPVFromBoundPVC ¶
func GetPVFromBoundPVC(pvc *corev1.PersistentVolumeClaim) (name string)
func GetPVSize ¶
func GetPVSize(pv *corev1.PersistentVolume) int64
func GetPVStorageSize ¶
func GetPVStorageSize(pv *corev1.PersistentVolume) int64
func GetStorageClassFromPV ¶
func GetStorageClassFromPV(pv *corev1.PersistentVolume, p storagev1informers.Interface) *storagev1.StorageClass
func GetStorageClassFromPVC ¶
func GetStorageClassFromPVC(pvc *corev1.PersistentVolumeClaim, p storagev1informers.Interface) *storagev1.StorageClass
func GetVGNameFromCsiPV ¶
func GetVGNameFromCsiPV(pv *corev1.PersistentVolume) string
GetVGNameFromCsiPV extracts vgName from open-local csi PV via VolumeAttributes
func GetVGNameFromPVC ¶
func GetVGNameFromPVC(pvc *corev1.PersistentVolumeClaim, p storagev1informers.Interface) string
func GetVGRequested ¶
func GetVGRequested(localPVs map[string]corev1.PersistentVolume, vgName string) (requested int64)
func HashSpec ¶
func HashSpec(storage *nodelocalstorage.NodeLocalStorage) uint64
func HashStorageSpec ¶
func HashStorageSpec(obj interface{}) uint64
func HashWithoutState ¶
func HashWithoutState(storage *nodelocalstorage.NodeLocalStorage) uint64
HashWithoutState remove the state field then compare
func HttpJSON ¶
func HttpJSON(w http.ResponseWriter, code int, result interface{})
func HttpResponse ¶
func HttpResponse(w http.ResponseWriter, code int, msg []byte)
func IsDirEmpty ¶
IsDirEmpty return status of dir empty or not
func IsFormatted ¶
IsFormatted checks whether the source device is formatted or not. It returns true if the source device is already formatted.
func IsLocalPVC ¶
func IsLocalPVC(claim *corev1.PersistentVolumeClaim, p storagev1informers.Interface, containReadonlySnapshot bool) (bool, localtype.VolumeType)
func IsLocalSnapshotPVC ¶ added in v0.2.2
func IsLocalSnapshotPVC(claim *corev1.PersistentVolumeClaim) bool
func IsOpenLocalPV ¶ added in v0.2.2
func IsOpenLocalPV(pv *corev1.PersistentVolume, p storagev1informers.Interface, c corev1informers.Interface, containReadonlySnapshot bool) (bool, localtype.VolumeType)
func IsSnapshotPVC ¶
func IsSnapshotPVC(claim *corev1.PersistentVolumeClaim) bool
func LocalPVType ¶ added in v0.2.2
func LocalPVType(sc *storagev1.StorageClass) localtype.VolumeType
func NeedSkip ¶ added in v0.3.0
func NeedSkip(args schedulerapi.ExtenderArgs) bool
func PodPvcAllowReschedule ¶
func PodPvcAllowReschedule(pvcs []*corev1.PersistentVolumeClaim, fakeNow *time.Time) bool
PodPvcAllowReschedule returns true if any of pvcs has in pending status for more than 5 minutes the fakeNow is parameter for unit testing
func PvcContainsSelectedNode ¶
func PvcContainsSelectedNode(pvc *corev1.PersistentVolumeClaim) bool
func SliceEquals ¶
func SliceEquals(src interface{}, dst interface{}) bool
func StringsContains ¶
StringsContains check val exist in array
func WordSepNormalizeFunc ¶
func WordSepNormalizeFunc(f *pflag.FlagSet, name string) pflag.NormalizedName
WordSepNormalizeFunc changes all flags that contain "_" separators
Types ¶
type CommandRunFunc ¶
CommandRunFunc define the run function in utils for ut
type Mounter ¶
type Mounter interface { // If the folder doesn't exist, it will call 'mkdir -p' EnsureFolder(target string) error // If the block doesn't exist, create it EnsureBlock(target string) error // Format formats the source with the given filesystem type Format(source, fsType string) error // Mount mounts source to target with the given fstype and options. Mount(source, target, fsType string, options ...string) error // Mount mounts source to target for block file. MountBlock(source, target string, options ...string) error // Unmount unmounts the given target Unmount(target string) error // IsFormatted checks whether the source device is formatted or not. It // returns true if the source device is already formatted. IsFormatted(source string) (bool, error) // IsMounted checks whether the target path is a correct mount (i.e: // propagated). It returns true if it's mounted. An error is returned in // case of system errors or if it's mounted incorrectly. IsMounted(target string) (bool, error) SafePathRemove(target string) error HasMountRefs(mountPath string, mountRefs []string) bool }
Mounter is responsible for formatting and mounting volumes