util

package
v0.0.0-...-9b348fc Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildResourceList

func BuildResourceList(resources map[v1.ResourceName]string) (v1.ResourceList, error)

BuildResourceList parses a map from resource names to quantities (in strings) to a v1.ResourceList. Returns error if failed to parse.

func PodKey

func PodKey(pod *v1.Pod) (string, error)

PodKey builds a key for the given pod. Returns error if the pod doesn't have valid (i.e., non-empty) namespace and name.

func PodKeyFromNames

func PodKeyFromNames(namespace string, name string) string

PodKeyFromNames builds a key from the namespace and pod name.

func PodPriority

func PodPriority(pod *v1.Pod) int32

PodPriority returns the priority of the given pod.

func PodTotalResourceRequests

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

PodTotalResourceRequests extracts the total amount of resource requested by the given pod.

func ResourceListGE

func ResourceListGE(r1, r2 v1.ResourceList) bool

ResourceListGE returns true when r1 >= r2, false otherwise.

func ResourceListSum

func ResourceListSum(r1, r2 v1.ResourceList) v1.ResourceList

ResourceListSum returns the sum of two resource lists.

func UpdatePodCondition

func UpdatePodCondition(clock clock.Clock, status *v1.PodStatus, condition *v1.PodCondition) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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