utils

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAndFinallyCall added in v0.2.0

func CheckAndFinallyCall(ctx context.Context, checkFunc func() bool, timeout, interval time.Duration, finally, timeoutCall func())

func ConvertByteNumToResourceQuantity

func ConvertByteNumToResourceQuantity(byteNum int64) resource.Quantity

func ExtractNodeIDFromNodeName added in v0.2.0

func ExtractNodeIDFromNodeName(nodeName string) string

func FormatNodeName added in v0.2.0

func FormatNodeName(nodeID string) string

func GetContainerKey added in v0.2.0

func GetContainerKey(podKey, containerName string) string

func GetContainerNameFromContainerKey added in v0.2.0

func GetContainerNameFromContainerKey(containerKey string) string

func GetEnv added in v0.2.0

func GetEnv(key, defaultValue string) string

func GetPodKey added in v0.2.0

func GetPodKey(pod *corev1.Pod) string

func GetPodKeyFromContainerKey added in v0.2.0

func GetPodKeyFromContainerKey(containerKey string) string

func PodsEqual

func PodsEqual(pod1, pod2 *corev1.Pod) bool

PodsEqual checks if two pods are equal according to the fields we know that are allowed to be modified after startup time.

func SplitMetaNamespaceKey added in v0.2.0

func SplitMetaNamespaceKey(key string) (namespace, name string, err error)

func TimedTaskWithInterval

func TimedTaskWithInterval(ctx context.Context, interval time.Duration, task func(context.Context))

func TranslateContainerStatusFromTunnelToContainerStatus added in v0.2.0

func TranslateContainerStatusFromTunnelToContainerStatus(container corev1.Container, data *model.ContainerStatusData) corev1.ContainerStatus

Types

This section is empty.

Jump to

Keyboard shortcuts

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