util

package
v1.4.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateMergePatch

func CreateMergePatch(original, new interface{}) ([]byte, error)

CreateMergePatch return patch generated from original and new interfaces

func GetGangGroupId added in v1.1.1

func GetGangGroupId(s []string) string

func GetGangMatchPolicyByPod added in v1.3.0

func GetGangMatchPolicyByPod(pod *v1.Pod) string

func GetGangMinNumFromPod added in v1.2.0

func GetGangMinNumFromPod(pod *v1.Pod) (minNum int, err error)

func GetGangNameByPod

func GetGangNameByPod(pod *v1.Pod) string

func GetId

func GetId(namespace, name string) string

func GetWaitTimeDuration added in v1.2.0

func GetWaitTimeDuration(pg *v1alpha1.PodGroup, defaultTimeout time.Duration) time.Duration

GetWaitTimeDuration returns a wait timeout based on the following precedences: 1. spec.scheduleTimeoutSeconds of the given pg, if specified 2. fall back to defaultTimeout

func IsPodNeedGang

func IsPodNeedGang(pod *v1.Pod) bool

func StringToGangGroupSlice

func StringToGangGroupSlice(s string) ([]string, error)

StringToGangGroupSlice Parse gang group's annotation like :"["nsA/gangA","nsB/gangB"]" => goLang slice : []string{"nsA/gangA"."nsB/gangB"}

Types

This section is empty.

Jump to

Keyboard shortcuts

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