Documentation ¶
Overview ¶
This file is a modified copy of k8s.io/kubernetes/pkg/quota/v1/resources.go
Index ¶
- func Add(a v1.ResourceList, b v1.ResourceList) v1.ResourceList
- func AddIfExists(a v1.ResourceList, b v1.ResourceList) v1.ResourceList
- func Equals(a v1.ResourceList, b v1.ResourceList) bool
- func FilterUnlimited(rawUsages v1.ResourceList, limits v1.ResourceList) v1.ResourceList
- func LessThanOrEqual(a v1.ResourceList, b v1.ResourceList) (bool, []v1.ResourceName)
- func Min(a v1.ResourceList, b v1.ResourceList) v1.ResourceList
- func OmitLTEZero(a v1.ResourceList) v1.ResourceList
- func Subtract(a v1.ResourceList, b v1.ResourceList) v1.ResourceList
- type Resources
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Add ¶
func Add(a v1.ResourceList, b v1.ResourceList) v1.ResourceList
Add returns the result of a + b for each named resource
func AddIfExists ¶
func AddIfExists(a v1.ResourceList, b v1.ResourceList) v1.ResourceList
Add returns the result of a + b for each named resource that exists in both a and b.
func Equals ¶
func Equals(a v1.ResourceList, b v1.ResourceList) bool
Equals returns true if the two lists are equivalent
func FilterUnlimited ¶
func FilterUnlimited(rawUsages v1.ResourceList, limits v1.ResourceList) v1.ResourceList
FilterUnlimited cleans up the raw usages by omitting not limited usages.
func LessThanOrEqual ¶
func LessThanOrEqual(a v1.ResourceList, b v1.ResourceList) (bool, []v1.ResourceName)
LessThanOrEqual returns true if a < b for each key in b If false, it returns the keys in a that exceeded b
func Min ¶
func Min(a v1.ResourceList, b v1.ResourceList) v1.ResourceList
Min returns the result of Min(a, b) (i.e., smallest resource quantity) for each named resource. If a resource only exists in one but not all ResourceLists inputs, it will be returned.
func OmitLTEZero ¶
func OmitLTEZero(a v1.ResourceList) v1.ResourceList
OmitLTEZero returns a list omitting zero or negative quantity resources.
func Subtract ¶
func Subtract(a v1.ResourceList, b v1.ResourceList) v1.ResourceList
Subtract returns the result of a - b for each named resource
Types ¶
type Resources ¶
type Resources map[v1.ResourceName]string
Resources maps a ResourceName to a string representation of a quantity.