resources

package
v0.18.1 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Ceiling added in v0.8.2

func Ceiling(pod *v1.Pod) v1.ResourceRequirements

Ceiling calculates the max between the sum of container resources and max of initContainers

func Cmp added in v0.8.0

func Cmp(lhs resource.Quantity, rhs resource.Quantity) int

func Fits added in v0.8.0

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

func IsZero(r resource.Quantity) bool

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

func LimitsForPods(pods ...*v1.Pod) v1.ResourceList

LimitsForPods returns the total resources of a variadic list of podspecs

func MaxResources added in v0.8.2

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

func MergeResourceLimitsIntoRequests(container v1.Container) v1.ResourceList

MergeResourceLimitsIntoRequests merges resource limits into requests if no request exists for the given resource

func Quantity

func Quantity(value string) *resource.Quantity

Quantity parses the string value into a *Quantity

func RequestsForPods

func RequestsForPods(pods ...*v1.Pod) v1.ResourceList

RequestsForPods returns the total resources of a variadic list of podspecs.

func String added in v0.8.0

func String(list v1.ResourceList) string

String returns a string version of the resource list suitable for presenting in a log

func StringMap added in v0.14.0

func StringMap(list v1.ResourceList) map[string]string

StringMap returns the string map representation of the resource list

func Subtract added in v0.9.1

func Subtract(lhs, rhs v1.ResourceList) v1.ResourceList

Types

This section is empty.

Jump to

Keyboard shortcuts

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