Documentation
¶
Index ¶
Constants ¶
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 ¶
func (r *QuotaController) Reconcile(ctx context.Context, req reconcile.Request) (reconcile.Result, error)
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.