util

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultWaitTime = 60 * time.Second

DefaultWaitTime is 60s if ScheduleTimeoutSeconds is not specified.

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 GetPodEffectiveRequest

func GetPodEffectiveRequest(pod *v1.Pod) v1.ResourceList

GetPodEffectiveRequest gets the effective request resource of a pod to the origin resource. The Pod's effective request is the higher of: - the sum of all app containers(spec.Containers) request for a resource. - the effective init containers(spec.InitContainers) request for a resource. The effective init containers request is the highest request on all init containers.

func GetPodGroupFullName

func GetPodGroupFullName(pod *v1.Pod) string

GetPodGroupFullName get namespaced group name from pod annotations

func GetPodGroupLabel

func GetPodGroupLabel(pod *v1.Pod) string

GetPodGroupLabel get pod group from pod annotations

func GetWaitTimeDuration

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

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

func ResourceList

func ResourceList(r *framework.Resource) v1.ResourceList

ResourceList returns a resource list of this resource. Note: this code used to exist in k/k, but removed in k/k#101465.

Types

This section is empty.

Jump to

Keyboard shortcuts

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