Documentation ¶
Index ¶
- func Ceiling(pod *v1.Pod) v1.ResourceRequirements
- func Cmp(lhs resource.Quantity, rhs resource.Quantity) int
- func Fits(candidate, total v1.ResourceList) bool
- func IsZero(r resource.Quantity) bool
- func LimitsForPods(pods ...*v1.Pod) v1.ResourceList
- func MaxResources(resources ...v1.ResourceList) v1.ResourceList
- func Merge(resources ...v1.ResourceList) v1.ResourceList
- func MergeInto(dest v1.ResourceList, src v1.ResourceList) v1.ResourceList
- func MergeResourceLimitsIntoRequests(container v1.Container) v1.ResourceList
- func Quantity(value string) *resource.Quantity
- func RequestsForPods(pods ...*v1.Pod) v1.ResourceList
- func String(list v1.ResourceList) string
- func Subtract(lhs, rhs v1.ResourceList) v1.ResourceList
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Fits ¶
func Fits(candidate, total v1.ResourceList) bool
Fits returns true if the candidate set of resources is less than or equal to the total set of resources.
func IsZero ¶
IsZero implements r.IsZero(). This method is provided to make some code a bit cleaner as the Quantity.IsZero() takes a pointer receiver and map index expressions aren't addressable, so it can't be called directly.
func LimitsForPods ¶
func LimitsForPods(pods ...*v1.Pod) v1.ResourceList
LimitsForPods returns the total resources of a variadic list of podspecs
func MaxResources ¶
func MaxResources(resources ...v1.ResourceList) v1.ResourceList
MaxResources returns the maximum quantities for a given list of resources
func Merge ¶
func Merge(resources ...v1.ResourceList) v1.ResourceList
Merge the resources from the variadic into a single v1.ResourceList
func MergeInto ¶
func MergeInto(dest v1.ResourceList, src v1.ResourceList) v1.ResourceList
MergeInto sums the resources from src into dest, modifying dest. If you need to repeatedly sum multiple resource lists, it allocates less to continually sum into an existing list as opposed to constructing a new one for each sum like Merge
func MergeResourceLimitsIntoRequests ¶
func MergeResourceLimitsIntoRequests(container v1.Container) v1.ResourceList
MergeResourceLimitsIntoRequests merges resource limits into requests if no request exists for the given resource
func RequestsForPods ¶
func RequestsForPods(pods ...*v1.Pod) v1.ResourceList
RequestsForPods returns the total resources of a variadic list of podspecs.
func String ¶
func String(list v1.ResourceList) string
String returns a string version of the resource list suitable for presenting in a log
func Subtract ¶
func Subtract(lhs, rhs v1.ResourceList) v1.ResourceList
Types ¶
This section is empty.