util

package
v0.14.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 6, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainsString added in v0.10.0

func ContainsString(slice []string, s string) bool

func DeleteResourceOfPod added in v0.10.0

func DeleteResourceOfPod(pod *corev1.Pod)

func GetMountDeviceRefs added in v0.13.2

func GetMountDeviceRefs(pathname string, corrupted bool) ([]string, error)

GetMountDeviceRefs Get all mountpoints whose source is the device of `pathname` mountpoint, the `pathname` will be excluded. The `pathname` must be a mountpoint, and if the `corrupted` is true, the `pathname` is a corrupted mountpoint.

func GetMountPathOfPod added in v0.10.7

func GetMountPathOfPod(pod corev1.Pod) (string, string, error)

func GetReferenceKey added in v0.10.7

func GetReferenceKey(target string) string

func GetTime added in v0.13.0

func GetTime(str string) (time.Time, error)

func GetTimeAfterDelay added in v0.13.0

func GetTimeAfterDelay(delayStr string) (string, error)

GetTimeAfterDelay get time which after delay

func IsJobCompleted added in v0.13.0

func IsJobCompleted(job *batchv1.Job) bool

func IsJobFailed added in v0.13.0

func IsJobFailed(job *batchv1.Job) bool

func IsPodError added in v0.10.0

func IsPodError(pod *corev1.Pod) bool

func IsPodHasResource added in v0.10.0

func IsPodHasResource(pod corev1.Pod) bool

func IsPodReady added in v0.10.0

func IsPodReady(pod *corev1.Pod) bool

func IsPodResourceError added in v0.10.0

func IsPodResourceError(pod *corev1.Pod) bool

func ParseEndpoint

func ParseEndpoint(endpoint string) (string, string, error)

func ParseMntPath added in v0.10.7

func ParseMntPath(cmd string) (string, string, error)

ParseMntPath return mntPath, volumeId (/jfs/volumeId, volumeId err)

func PatchPodAnnotation added in v0.13.2

func PatchPodAnnotation(client *k8s.K8sClient, pod *corev1.Pod, annotation map[string]string) error

func QuoteForShell added in v0.13.0

func QuoteForShell(cmd string) string

func ShouldDelay added in v0.13.0

func ShouldDelay(pod *corev1.Pod, Client *k8s.K8sClient) (shouldDelay bool, err error)

func StripPasswd added in v0.13.0

func StripPasswd(uri string) string

Types

type PVCMetadata added in v0.13.3

type PVCMetadata struct {
	// contains filtered or unexported fields
}

func NewPVCMeta added in v0.13.3

func NewPVCMeta(pvc v1.PersistentVolumeClaim) *PVCMetadata

func (*PVCMetadata) StringParser added in v0.13.3

func (meta *PVCMetadata) StringParser(str string) string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL