Help us shape the future of Go! Take the 2026 Go Developer Survey

quota

package
v0.13.10 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClampQuantityToZero

func ClampQuantityToZero(q *resource.Quantity)

func ConditionsMatch

func ConditionsMatch(u unstructured.Unstructured, conditions []*jsonpath.CompiledJSONPath) (bool, error)

func MakeCustomQuotaCacheKey

func MakeCustomQuotaCacheKey(namespace, name string) string

func MakeGlobalCustomQuotaCacheKey

func MakeGlobalCustomQuotaCacheKey(name string) string

func NegateQuantity

func NegateQuantity(in resource.Quantity) resource.Quantity

func ParseBoolFromUnstructured

func ParseBoolFromUnstructured(u unstructured.Unstructured, compiled *jsonpath.CompiledJSONPath) (bool, error)

func ParseQuantities

func ParseQuantities(value string) (resource.Quantity, 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 QuantityEqual(a, b resource.Quantity) bool

func ValidateQuantity

func ValidateQuantity(q resource.Quantity) error

Types

type MatchedQuota

type MatchedQuota struct {
	Key          string
	Name         string
	Namespace    string
	Path         string
	CompiledPath *jsonpath.CompiledJSONPath
	Operation    Operation
	Limit        resource.Quantity
	Used         resource.Quantity
	IsGlobal     bool
	SourceRank   int
}

Overlay for Global/Namespace CustomQuotas.

type Operation

type Operation string

+kubebuilder:validation:Enum=add;sub;count

const (
	OpAdd   Operation = "add"
	OpSub   Operation = "sub"
	OpCount Operation = "count"
)

Jump to

Keyboard shortcuts

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