Documentation
¶
Index ¶
- Constants
- func CreateMergePatch(original, new interface{}) ([]byte, error)
- func GetPodEffectiveRequest(pod *v1.Pod) v1.ResourceList
- func GetPodGroupFullName(pod *v1.Pod) string
- func GetPodGroupLabel(pod *v1.Pod) string
- func GetWaitTimeDuration(pg *v1alpha1.PodGroup, scheduleTimeout *time.Duration) time.Duration
- func NewClientWithCachedReader(ctx context.Context, config *rest.Config, scheme *runtime.Scheme) (client.Client, cache.Cache, error)
- func ResourceList(r *framework.Resource) v1.ResourceList
Constants ¶
const DefaultWaitTime = 60 * time.Second
DefaultWaitTime is 60s if ScheduleTimeoutSeconds is not specified.
Variables ¶
This section is empty.
Functions ¶
func CreateMergePatch ¶
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 ¶
GetPodGroupFullName get namespaced group name from pod labels
func GetPodGroupLabel ¶
GetPodGroupLabel get pod group name from pod labels
func GetWaitTimeDuration ¶
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.