Repository navigation
api/tenants: Remove the plan from the API - #141
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The
planof 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).planis gone from the body of a tenant (GET, list,POST,PATCH) and fromGET /v1/tenants/{t}/quota. The API no longer readsspec.plan.spec.planon the Tenant object, on creation or onPATCH. 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.plan(create or patch) gets400, the answer of the strict decoder for any field the API does not know. It was403for a plan other thansmallbefore. Authorization still comes first: a caller without the right gets403whatever the body says.PATCH /v1/tenants/{t}with an empty body saysnothing to change: give displayName.holdings(instances, networks) no longer returns a plan; the typestenants.Plan,Small,MediumandLargeare removed.Planschema and its uses,TenantCreate,TenantPatch,Tenant,Quota),docs/reference/tenants.mdanddocs/reference/limits-and-quotas.mdsay 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 ofspec.planfrom 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 noplankey, that every tenant has the same limits, that aplanis400on create and patch (a person, an admin, a key withtenants:write) and403for a viewer, and that the store writes nospec.plan.gofmt -l,go vet ./...,go test -race ./...andyamllint --stricton the OpenAPI are clean locally; the docs check passes.golangci-lintis not installed locally, CI runs it.Closes #139