quota

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2025 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const ControllerName = "quota-controller"

Variables

This section is empty.

Functions

This section is empty.

Types

type QuotaController

type QuotaController struct {
	Client                 client.Client
	Config                 *config.QuotaDefinition
	ActiveQuotaDefinitions sets.Set[string]
}

QuotaController actually reconciles namespaces, but it gets triggered by generation changes of - ResourceQuotas with an OwnerReference pointing to the namespace - QuotaIncreases in the namespace

func NewQuotaController

func NewQuotaController(c client.Client, cfg *config.QuotaDefinition, activeQuotaDefinitions sets.Set[string]) *QuotaController

NewQuotaController creates a new QuotaController instance. The activeQuotaDefinitions set should contain the names of all QuotaDefinitions from all QuotaControllers running in the same cluster.

func (*QuotaController) Reconcile

Reconcile contains the main logic of creating and updating a ResourceQuota based on the QuotaIncreases in the reconciled Namespace. The Namespace is registered as controller of the ResourceQuota and reacts on changes to QuotaIncreases within the namespace (even without owner reference), so this gets triggered if either is modified.

func (*QuotaController) SetupWithManager

func (r *QuotaController) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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