generic

package
v1.9.11-beta.0 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

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.ResourceQuotaScope, 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 compatibilty 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

func NewRegistry(evaluators []quota.Evaluator) quota.Registry

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

type ListFuncByNamespace func(namespace string) ([]runtime.Object, error)

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.ResourceQuotaScope, 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

type UsageFunc

type UsageFunc func(object runtime.Object) (api.ResourceList, error)

UsageFunc knows how to measure usage associated with an object

Jump to

Keyboard shortcuts

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