util

package
v0.32.7 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2025 License: Apache-2.0 Imports: 14 Imported by: 1

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 added in v0.22.6

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. Additionally, if the Pod specifies overhead, it will also be included in the final calculation.

func GetPodGroupFullName

func GetPodGroupFullName(pod *v1.Pod) string

GetPodGroupFullName get namespaced group name from pod labels

func GetPodGroupLabel

func GetPodGroupLabel(pod *v1.Pod) string

GetPodGroupLabel get pod group name from pod labels

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 NewClientWithCachedReader added in v0.30.12

func NewClientWithCachedReader(ctx context.Context, config *rest.Config, scheme *runtime.Scheme) (client.Client, cache.Cache, error)

NewClientWithCachedReader returns a controller runtime Client with cache-baked client.

func ResourceList added in v0.22.6

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