Skip to content

api/tenants: Remove the plan from the API - #141

Merged
l-nmch merged 1 commit into
mainfrom
fix/remove-plan
Nov 14, 2026
Merged

l-nmch merged 1 commit into
mainfrom
fix/remove-plan

Conversation

@l-nmch

@l-nmch l-nmch commented Nov 14, 2026

Copy link
Copy Markdown
Member

What

The plan of a tenant leaves the API. Every tenant has the same limits (2 instances, 2 vCPU, 4 GiB, 128 GiB of disk, 2 networks, 2 profiles), so the field limited nothing and was kept only until the console stopped reading it (phorge-fr/phorge-console#81, deployed).

  • Reads: plan is gone from the body of a tenant (GET, list, POST, PATCH) and from GET /v1/tenants/{t}/quota. The API no longer reads spec.plan.
  • Writes: the API no longer writes spec.plan on the Tenant object, on creation or on PATCH. Until the field leaves the XRD (control/crossplane: Remove spec.plan from the Tenant kind Hangar#474) the XRD default applies, as it already did for a creation without a plan.
  • A client that still sends plan (create or patch) gets 400, the answer of the strict decoder for any field the API does not know. It was 403 for a plan other than small before. Authorization still comes first: a caller without the right gets 403 whatever the body says.
  • PATCH /v1/tenants/{t} with an empty body says nothing to change: give displayName.
  • holdings (instances, networks) no longer returns a plan; the types tenants.Plan, Small, Medium and Large are removed.
  • OpenAPI (Plan schema and its uses, TenantCreate, TenantPatch, Tenant, Quota), docs/reference/tenants.md and docs/reference/limits-and-quotas.md say there is no plan.

This is a breaking change of the contract, hence feat!: (a minor release while the API is below 1.0). The console already ignores the field. The removal of spec.plan from the Tenant kind is the last step of the epic, phorge-fr/Hangar#474, after this is released and deployed.

Tests

  • internal/tenants, internal/kube, internal/api: the tests that used a plan no longer do; new checks that the quota answer has no plan key, that every tenant has the same limits, that a plan is 400 on create and patch (a person, an admin, a key with tenants:write) and 403 for a viewer, and that the store writes no spec.plan.
  • gofmt -l, go vet ./..., go test -race ./... and yamllint --strict on the OpenAPI are clean locally; the docs check passes. golangci-lint is not installed locally, CI runs it.
  • Not run: the integration tests (they need the cluster).

Closes #139

Every tenant has the same limits, so a tenant has no plan. The field leaves the body of a tenant, the creation and patch bodies and the
quota answer, and the API stops reading and writing spec.plan on the Tenant object. A body that still gives a plan is refused as any
field the API does not know (400).

The OpenAPI, the reference pages and the tests are updated.

Closes #139
@l-nmch l-nmch added this to the 2027-Q1 milestone Nov 14, 2026
@l-nmch l-nmch added the area/api Phorge API and console label Nov 14, 2026
@l-nmch l-nmch self-assigned this Nov 14, 2026
@l-nmch l-nmch added this to Roadmap Nov 14, 2026
@l-nmch
l-nmch merged commit f41342f into main Nov 14, 2026
14 checks passed
@l-nmch
l-nmch deleted the fix/remove-plan branch November 14, 2026 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/api Phorge API and console

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Remove the plan from the API

1 participant