fix(reconciler): enforce org quotas to close the org bypass (#121) #151
Inga granskare
Etiketter
Inga etiketter
area/backups
area/ci
area/control-panel
area/identity
area/infra
area/observability
area/payments
area/security
area/storage
area/web
blocked
needs-info
needs-triage
ready-for-implementation
type
bug
type
chore
type
docs
type
epic
type
feature
type
task
wontfix
Ingen milstolpe
Inget projekt
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Inget förfallodatum satt.
Beroenden
Inga beroenden satta
Referens
bitborg/bitborg-infra!151
Läser in…
Hänvisa till i nytt ärende
Ingen beskrivning angiven.
Ta bort grenen "fix/121-org-quota"
Borttagning av en gren är permanent. Även om den borttagna grenen kan fortsätta existera en kort tid innan den faktiskt tas bort, kan det INTE ångras i de flesta fall. Vill du fortsätta?
#121 part 2 — org quota enforcement
Orgs are separate quota owners the reconciler never touched (§4 was a TODO), so every org fell to
[quota.default] = -1= unlimited → a user could push unlimited data into an org and fill the shared 60 GB data volume (full-instance outage).Change (
roles/reconciler)ensure_size_group— creates a quota group with a singlesize:allrule (total cap over repos + LFS + packages; nobaserule, so the cap isn't defeated by the most-permissive merge).org-default(size:all = 5 GiB, tenant orgs) andorg-unlimited(-1, first-party/exempt orgs)./api/v1/admin/orgsand assign each to its target group (exempt →org-unlimited, else →org-default), same idempotent add-to-target / remove-from-other pattern as users.reconciler_org_exempt: ["bitborg"]— the platform's own org owns all the project repos and must not be capped. It's assigned toorg-unlimitedexplicitly (not just skipped) so it also overrides the fail-closed default group from PR-C via the most-permissive merge.Why 5 GiB
Orgs have no Kanidm tier signal and can have multiple owners, so a flat default is pragmatic; an org needing more gets a manual bump (rare, and org-create is now gated by PR-A).
Validation
ansible-lint (production) ·
--check --diffrenders clean (0 failed) ·bash -non the new logic.Runtime correctness (the admin/orgs JSON field + orgs being assignable to quota groups) will be confirmed by a dry-run at apply time: the reconciler logs
org <name>: quota=<group>for every org before anything is applied — review that first, then let RECONCILE_APPLY proceed.Apply/ordering note
Apply this before PR-C (
DEFAULT_GROUPS = participant) so thegitborgorg is already inorg-unlimitedand can't be caught by the fail-closed default. Confirm the first live run assignsbitborg → org-unlimitedand pushes to the platform repos still work.Refs #121.
560866d3180b939838c6