Documentation
¶
Index ¶
- func GetQuotaAdmission(quota *v1alpha1.ElasticQuota) (corev1.ResourceList, error)
- func IsDefaultDeny(err error) bool
- func NewQuotaAccessor(c client.Client) *quotaAccessor
- func PodUsageFunc(pod *corev1.Pod, clock clock.Clock) (corev1.ResourceList, error)
- func QuotaV1Pod(pod *corev1.Pod, clock clock.Clock) bool
- type Attributes
- type Evaluator
- type QuotaAccessor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetQuotaAdmission ¶
func GetQuotaAdmission(quota *v1alpha1.ElasticQuota) (corev1.ResourceList, error)
func IsDefaultDeny ¶
IsDefaultDeny returns true if the error is defaultDeny
func NewQuotaAccessor ¶
NewQuotaAccessor creates an object that conforms to the QuotaAccessor interface to be used to retrieve quota objects.
func PodUsageFunc ¶
Types ¶
type Attributes ¶
type Evaluator ¶
type Evaluator interface { // Evaluate takes an operation and checks to see if quota constraints are satisfied. It returns an error if they are not. // The default implementation processes related operations in chunks when possible. Evaluate(a *Attributes) error }
Evaluator is used to see if quota constraints are satisfied.
func NewQuotaEvaluator ¶
func NewQuotaEvaluator(quotaAccessor QuotaAccessor, workers int, stopCh <-chan struct{}) Evaluator
type QuotaAccessor ¶
type QuotaAccessor interface { // UpdateQuotaStatus is called to persist final status. This method should write to persistent storage. // An error indicates that write didn't complete successfully. UpdateQuotaStatus(newQuota *v1alpha1.ElasticQuota) error // GetQuota gets the specificated elastic quota. GetQuota(key string) (*v1alpha1.ElasticQuota, error) }
QuotaAccessor abstracts the get/set logic from the rest of the Evaluator. This could be a test stub, a straight passthrough, or most commonly a series of deconflicting caches.
Click to show internal directories.
Click to hide internal directories.