Documentation ¶
Index ¶
- func CalculateUsageStats(options quota.UsageStatsOptions, listFunc ListFuncByNamespace, ...) (quota.UsageStats, error)
- func ListerFuncForResourceFunc(f InformerForResourceFunc) quota.ListerForResourceFunc
- func Matches(resourceQuota *corev1.ResourceQuota, item runtime.Object, ...) (bool, error)
- func MatchesNoScopeFunc(scope corev1.ScopedResourceSelectorRequirement, object runtime.Object) (bool, error)
- func NewConfiguration(evaluators []quota.Evaluator, ...) quota.Configuration
- func NewObjectCountEvaluator(groupResource schema.GroupResource, listFuncByNamespace ListFuncByNamespace, ...) quota.Evaluator
- func NewRegistry(evaluators []quota.Evaluator) quota.Registry
- func ObjectCountQuotaResourceNameFor(groupResource schema.GroupResource) corev1.ResourceName
- type InformerForResourceFunc
- type ListFuncByNamespace
- type MatchesScopeFunc
- type MatchingResourceNamesFunc
- type UsageFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculateUsageStats ¶
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 ¶
func ListerFuncForResourceFunc(f InformerForResourceFunc) quota.ListerForResourceFunc
ListerFuncForResourceFunc knows how to provision a lister from an informer func
func Matches ¶
func Matches( resourceQuota *corev1.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 corev1.ScopedResourceSelectorRequirement, object runtime.Object) (bool, error)
MatchesNoScopeFunc returns false on all match checks
func NewConfiguration ¶
func NewConfiguration(evaluators []quota.Evaluator, ignoredResources map[schema.GroupResource]struct{}) quota.Configuration
NewConfiguration creates a quota configuration
func NewObjectCountEvaluator ¶
func NewObjectCountEvaluator( groupResource schema.GroupResource, listFuncByNamespace ListFuncByNamespace, alias corev1.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 ¶
NewRegistry creates a simple registry with initial list of evaluators
func ObjectCountQuotaResourceNameFor ¶
func ObjectCountQuotaResourceNameFor(groupResource schema.GroupResource) corev1.ResourceName
ObjectCountQuotaResourceNameFor returns the object count quota name for specified groupResource
Types ¶
type InformerForResourceFunc ¶
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 ¶
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 corev1.ScopedResourceSelectorRequirement, object runtime.Object) (bool, error)
MatchesScopeFunc knows how to evaluate if an object matches a scope
type MatchingResourceNamesFunc ¶
type MatchingResourceNamesFunc func(input []corev1.ResourceName) []corev1.ResourceName
MatchingResourceNamesFunc is a function that returns the list of resources matched