utils

package
v0.0.24 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2022 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileExists

func FileExists(path string) bool

func GetCpuAndMemoryQuantity

func GetCpuAndMemoryQuantity(pod v1beta1.PodMetrics) (cpu *resource.Quantity, memory *resource.Quantity)

func HandlePanic

func HandlePanic(title string)

func HumanDuration added in v0.0.22

func HumanDuration(d time.Duration) string

func IsPodRunning

func IsPodRunning(kubeClient kubernetes.Interface, namespace, podName string) (running bool, notRunningReason string)

func K8sClientByClusterID

func K8sClientByClusterID[T ~int | ~int8 | ~int32 | ~int64](id T) contracts.K8s

func Md5

func Md5(data string) string

func RandomString

func RandomString(length int) string

func ToRFC3339DatetimeString

func ToRFC3339DatetimeString(t *time.Time) string

func TracingChildOfFn

func TracingChildOfFn(ctx context.Context, name string, fn func())

func TracingFromCtx

func TracingFromCtx(ctx context.Context, name string) func()

Types

type CopyFileToPodResult

type CopyFileToPodResult struct {
	TargetDir     string
	ErrOut        string
	StdOut        string
	ContainerPath string
	FileName      string
}

func CopyFileToPod

func CopyFileToPod(kubeClient kubernetes.Interface, restConfig *restclient.Config, namespace, pod, container, fpath, targetContainerDir string) (*CopyFileToPodResult, error)

Jump to

Keyboard shortcuts

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