Add per-user resource quota enforcement across all four dimensions: max_servers, max_cpu_milli, max_memory_mb, and max_storage_gb. - Migration 0013: add cached_cpu_milli, cached_memory_mb, cached_storage_mb columns to servers table for pure-SQL per-owner aggregation - SeedServer now writes resource cache alongside server row - QuotaCheck replaces QuotaAvailable at claim time, checking all four caps against the owning user's cumulative usage - handlePatchServer checks owner's quota before allowing memory/resource changes on owned servers; unowned servers skip the gate - handleInternalClaim mirrors the full quota check - UpdateServerResources keeps the cache in sync after spec mutations - Reaper zeros resource cache on ReleaseWorld so released resources are not counted against a former owner - quantityToMilli/quantityToMB helpers convert K8s quantities to quota-comparable integers 19 test packages pass.
4 lines
219 B
SQL
4 lines
219 B
SQL
ALTER TABLE servers ADD COLUMN cached_cpu_milli int NOT NULL DEFAULT 0;
|
|
ALTER TABLE servers ADD COLUMN cached_memory_mb int NOT NULL DEFAULT 0;
|
|
ALTER TABLE servers ADD COLUMN cached_storage_mb int NOT NULL DEFAULT 0;
|