kubernetes: k8s.io/kubernetes/pkg/quota/v1/generic Index | Files

package generic

import "k8s.io/kubernetes/pkg/quota/v1/generic"


Package Files

configuration.go evaluator.go registry.go

func CalculateUsageStats Uses

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 Uses

func ListerFuncForResourceFunc(f InformerForResourceFunc) quota.ListerForResourceFunc

ListerFuncForResourceFunc knows how to provision a lister from an informer func. The lister returns errors until the informer has synced.

func Matches Uses

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 Uses

func MatchesNoScopeFunc(scope corev1.ScopedResourceSelectorRequirement, object runtime.Object) (bool, error)

MatchesNoScopeFunc returns false on all match checks

func NewConfiguration Uses

func NewConfiguration(evaluators []quota.Evaluator, ignoredResources map[schema.GroupResource]struct{}) quota.Configuration

NewConfiguration creates a quota configuration

func NewObjectCountEvaluator Uses

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 Uses

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

NewRegistry creates a simple registry with initial list of evaluators

func ObjectCountQuotaResourceNameFor Uses

func ObjectCountQuotaResourceNameFor(groupResource schema.GroupResource) corev1.ResourceName

ObjectCountQuotaResourceNameFor returns the object count quota name for specified groupResource

type InformerForResourceFunc Uses

type InformerForResourceFunc func(schema.GroupVersionResource) (informers.GenericInformer, error)

InformerForResourceFunc knows how to provision an informer

type ListFuncByNamespace Uses

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

ListFuncByNamespace knows how to list resources in a namespace

func ListResourceUsingListerFunc Uses

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 Uses

type MatchesScopeFunc func(scope corev1.ScopedResourceSelectorRequirement, object runtime.Object) (bool, error)

MatchesScopeFunc knows how to evaluate if an object matches a scope

type MatchingResourceNamesFunc Uses

type MatchingResourceNamesFunc func(input []corev1.ResourceName) []corev1.ResourceName

MatchingResourceNamesFunc is a function that returns the list of resources matched

type UsageFunc Uses

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

UsageFunc knows how to measure usage associated with an object

Package generic imports 12 packages (graph) and is imported by 24 packages. Updated 2019-11-06. Refresh now. Tools for package owners.