Documentation
¶
Index ¶
- func ClampQuantityToZero(q *resource.Quantity)
- func ConditionsMatch(u unstructured.Unstructured, conditions []*jsonpath.CompiledJSONPath) (bool, error)
- func MakeCustomQuotaCacheKey(namespace, name string) string
- func MakeGlobalCustomQuotaCacheKey(name string) string
- func NegateQuantity(in resource.Quantity) resource.Quantity
- func ParseBoolFromUnstructured(u unstructured.Unstructured, compiled *jsonpath.CompiledJSONPath) (bool, error)
- func ParseQuantities(value string) (resource.Quantity, error)
- func ParseQuantityFromUnstructured(u unstructured.Unstructured, compiled *jsonpath.CompiledJSONPath) (resource.Quantity, error)
- func ParseUsageFromUnstructured(u unstructured.Unstructured, compiled *jsonpath.CompiledJSONPath) (string, error)
- func QuantityEqual(a, b resource.Quantity) bool
- func ValidateHardLimit(path string, hard, allocated corev1.ResourceList) error
- func ValidateHardLimitScopeChange(path string, hard corev1.ResourceList, previous corev1.ResourceList, ...) error
- func ValidateQuantity(q resource.Quantity) error
- type MatchedQuota
- type Operation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClampQuantityToZero ¶
func ConditionsMatch ¶
func ConditionsMatch(u unstructured.Unstructured, conditions []*jsonpath.CompiledJSONPath) (bool, error)
func MakeCustomQuotaCacheKey ¶
func ParseBoolFromUnstructured ¶
func ParseBoolFromUnstructured(u unstructured.Unstructured, compiled *jsonpath.CompiledJSONPath) (bool, error)
func ParseQuantityFromUnstructured ¶
func ParseQuantityFromUnstructured(u unstructured.Unstructured, compiled *jsonpath.CompiledJSONPath) (resource.Quantity, error)
func ParseUsageFromUnstructured ¶
func ParseUsageFromUnstructured(u unstructured.Unstructured, compiled *jsonpath.CompiledJSONPath) (string, error)
GetUsageFromUnstructured extracts a value from an unstructured object using a JSONPath source path. It is convenient for one-off calls. For repeated calls with the same sourcePath, prefer CompileUsageJSONPath(...) and then Execute(...) to avoid reparsing.
func QuantityEqual ¶ added in v0.13.5
func ValidateHardLimit ¶ added in v0.14.0
func ValidateHardLimit(path string, hard, allocated corev1.ResourceList) error
ValidateHardLimit rejects removal or reduction of a hard resource below an already allocated quantity. Path identifies the hard-limit field in the returned validation error.
func ValidateHardLimitScopeChange ¶ added in v0.14.0
func ValidateHardLimitScopeChange( path string, hard corev1.ResourceList, previous corev1.ResourceList, scopeChanged bool, ) error
ValidateHardLimitScopeChange prevents a quota from reducing or removing a hard limit in the same update that changes its namespace selection. Usage from newly selected namespaces is not represented by the quota's previous status yet, so the scope must reconcile before a safe lower bound is known.
func ValidateQuantity ¶
Types ¶
type MatchedQuota ¶
type MatchedQuota struct {
Key string
Name string
Namespace string
Path string
CompiledPath *jsonpath.CompiledJSONPath
CEL string
CompiledCEL *celruntime.CompiledExpression
Operation Operation
Limit resource.Quantity
Used resource.Quantity
IsGlobal bool
SourceRank int
}
Overlay for Global/Namespace CustomQuotas.