utils

package
v0.0.86 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2023 License: MIT Imports: 23 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 IsPodRunning

func IsPodRunning(kubeClient contracts.K8s, namespace, podName string) (running bool, notRunningReason string)

func K8sClientByClusterID

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

func RandomString

func RandomString(length int) string

func TracingChildOfFn

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

func TracingFromCtx

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

Types

type Closeable added in v0.0.46

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

func (*Closeable) Close added in v0.0.46

func (c *Closeable) Close() bool

func (*Closeable) IsClosed added in v0.0.46

func (c *Closeable) IsClosed() bool

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)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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