generic

package
v1.0.1-0...-5dc2c13 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 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

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 *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

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 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

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

NewRegistry creates a simple registry with initial list of evaluators

func ObjectCountQuotaResourceNameFor

func ObjectCountQuotaResourceNameFor(groupResource schema.GroupResource) api.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

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

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 api.ScopedResourceSelectorRequirement, object runtime.Object) (bool, error)

MatchesScopeFunc knows how to evaluate if an object matches a scope

type MatchingResourceNamesFunc

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