Repository navigation
api/profiles: Give a profile the secure boot and the SSH keys of an instance - #132
Merged
Merged
Conversation
POST /v1/tenants/{t}/profiles takes secureBoot and sshPublicKeys, which an
instance takes from its profile unless it says its own. The keys are checked by
the function of the instance. A setting the request does not give is not written
on the Profile, so an absent secureBoot is never false, and the body of a profile
shows only what it says. A profile has no nesting and no network: the strict
decoding refuses them.
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
A profile the user makes can say two settings of an instance beside its size:
secureBootandsshPublicKeys. The Hangar side is merged (phorge-fr/Hangar#454): theProfilekind carries them, and anInstancetakes them from its profile unless it says its own.POST /v1/tenants/{t}/profilestakessecureBoot(boolean, no default) andsshPublicKeys(up to 20).checkKeys), not a copy.Profilespec only when the request gives it: an absentsecureBootstays absent and is neverfalse; an empty list of keys is the same as none and is not written.400fornestingornetworks, as for any unknown field.ProfileCreateandProfile. Thedefault: trueof the instance'ssecureBootis removed from the spec, because the API sends nothing when the request leaves it out and the instance then takes its profile's value (the description says so, as for the keys).docs/reference/images-and-instances.md.Not in this change
PATCHof a profile: there is none today (a profile is replaced by making another one), so there is nothing to keep consistent. The Hangar kind can be changed in place; the API does not offer it yet.MAX_PROFILES_PER_TENANT, which counts the profiles a tenant made as before. The per-plan limit of profiles is One plan for every tenant in the API: the limits, 2 networks, 2 profiles #131.Checked
go vet ./...,gofmt -l,go test -race ./...andyamllint --strict .pass, and so does the docs layout check. New tests: validation of the keys of a profile (same cases as the instance), the routes (both fields, one of them, neither, refusal of nesting, a network and bad keys, absent fields in the answers), and the kube store (written only when given,falsewritten, read back by the found flag). Nothing was run against a cluster.Closes #116