Documentation ¶
Index ¶
- func CalculateUsageStats(options quota.UsageStatsOptions, listFunc ListFuncByNamespace, ...) (quota.UsageStats, error)
- func ListerFuncForResourceFunc(f InformerForResourceFunc) quota.ListerForResourceFunc
- func Matches(resourceQuota *api.ResourceQuota, item runtime.Object, ...) (bool, error)
- func MatchesNoScopeFunc(scope api.ScopedResourceSelectorRequirement, object runtime.Object) (bool, error)
- func NewConfiguration(evaluators []quota.Evaluator, ...) quota.Configuration
- func NewObjectCountEvaluator(allowCreateOnUpdate bool, groupResource schema.GroupResource, ...) quota.Evaluator
- func NewRegistry(evaluators []quota.Evaluator) quota.Registry
- func ObjectCountQuotaResourceNameFor(groupResource schema.GroupResource) api.ResourceName
- type InformerForResourceFunc
- type ListFuncByNamespace
- type MatchesScopeFunc
- type MatchingResourceNamesFunc
- type UsageFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculateUsageStats ¶ added in v1.6.0
func CalculateUsageStats(options quota.UsageStatsOptions, listFunc ListFuncByNamespace, scopeFunc MatchesScopeFunc, usageFunc UsageFunc) (quota.UsageStats, error)
CalculateUsageStats is a utility function that knows how to calculate aggregate usage.
func ListerFuncForResourceFunc ¶ added in v1.9.0
func ListerFuncForResourceFunc(f InformerForResourceFunc) quota.ListerForResourceFunc
ListerFuncForResourceFunc knows how to provision a lister from an informer func
func Matches ¶ added in v1.6.0
func Matches( resourceQuota *api.ResourceQuota, item runtime.Object, matchFunc MatchingResourceNamesFunc, scopeFunc MatchesScopeFunc) (bool, error)
Matches returns true if the quota matches the specified item.
func MatchesNoScopeFunc ¶
func MatchesNoScopeFunc(scope api.ScopedResourceSelectorRequirement, object runtime.Object) (bool, error)
MatchesNoScopeFunc returns false on all match checks
func NewConfiguration ¶ added in v1.9.0
func NewConfiguration(evaluators []quota.Evaluator, ignoredResources map[schema.GroupResource]struct{}) quota.Configuration
NewConfiguration creates a quota configuration
func NewObjectCountEvaluator ¶ added in v1.9.0
func NewObjectCountEvaluator( allowCreateOnUpdate bool, groupResource schema.GroupResource, listFuncByNamespace ListFuncByNamespace, alias api.ResourceName) quota.Evaluator
NewObjectCountEvaluator returns an evaluator that can perform generic object quota counting. It allows an optional alias for backwards compatibility purposes for the legacy object counting names in quota. Unless its supporting backward compatibility, alias should not be used.
func NewRegistry ¶ added in v1.9.0
NewRegistry creates a simple registry with initial list of evaluators
func ObjectCountQuotaResourceNameFor ¶ added in v1.9.0
func ObjectCountQuotaResourceNameFor(groupResource schema.GroupResource) api.ResourceName
ObjectCountQuotaResourceNameFor returns the object count quota name for specified groupResource
Types ¶
type InformerForResourceFunc ¶ added in v1.9.0
type InformerForResourceFunc func(schema.GroupVersionResource) (informers.GenericInformer, error)
InformerForResourceFunc knows how to provision an informer
type ListFuncByNamespace ¶
ListFuncByNamespace knows how to list resources in a namespace
func ListResourceUsingListerFunc ¶ added in v1.9.0
func ListResourceUsingListerFunc(l quota.ListerForResourceFunc, resource schema.GroupVersionResource) ListFuncByNamespace
ListResourceUsingListerFunc returns a listing function based on the shared informer factory for the specified resource.
type MatchesScopeFunc ¶
type MatchesScopeFunc func(scope api.ScopedResourceSelectorRequirement, object runtime.Object) (bool, error)
MatchesScopeFunc knows how to evaluate if an object matches a scope
type MatchingResourceNamesFunc ¶ added in v1.6.0
type MatchingResourceNamesFunc func(input []api.ResourceName) []api.ResourceName
MatchingResourceNamesFunc is a function that returns the list of resources matched