utils

package
v0.1.2-test Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DiagnosisToPhase

func DiagnosisToPhase(result *share.ReasonResult) map[string]interface{}

func ExtractQuotaResource

func ExtractQuotaResource(msg string) string

从msg中提取quota不足的资源

func FirstUpper

func FirstUpper(s string) string

首字母大写

func GetConditionName

func GetConditionName(msg string) *string

获取被node的condition驱逐的原因

func GetContainerName

func GetContainerName(msg string) *string

获取容器名称

func GetContainerNameByImageName

func GetContainerNameByImageName(image string, pod *corev1.Pod) string

根据镜像找到容器的名字

func GetContainerStatus

func GetContainerStatus(containerName string, pod *corev1.Pod) *corev1.ContainerStatus

从pod的containerstatuses中获取某个container壮体啊

func GetCreatedAndStartedContainerName

func GetCreatedAndStartedContainerName(msg string) []string

从Created reason 获取container name msg:"Created container task, elapsedTime 65.729783ms" msg: "Started container task, elapsedTime 261.205298ms" msg: ""

func GetImageName

func GetImageName(msg string) *string

获取镜像名称

func GetKilledContainerName

func GetKilledContainerName(msg string) []string

从Killed message 获取container name

func GetPodYamlFromHyperEvents

func GetPodYamlFromHyperEvents(auditEvents []*shares.AuditEvent, endTime *time.Time) *corev1.Pod

从hyper event数组中获取最新pod yaml

func GetPostStartHookElapsed

func GetPostStartHookElapsed(msg string) *string

获取poststarthook耗时时间

func GetPostStartHookTimeout

func GetPostStartHookTimeout(msg string) *string

获取poststarthook超时时间

func IsPodReady

func IsPodReady(pod *corev1.Pod, startTime *time.Time) bool

判断pod是否ready

func IsPodSucceed

func IsPodSucceed(pod *corev1.Pod) bool

判断pod是否ready

func PodConditionExists

func PodConditionExists(conditions []corev1.PodCondition, conditionKey string) bool

PodConditionExists() whether the condition is exists.

Types

This section is empty.

Jump to

Keyboard shortcuts

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