Rename EditorTemplate to EditorModel; serve via impersonated client#431
Merged
Conversation
Rename the editor storage to EditorModel and reconstruct the editor model from the request's chart values via editor.EditorChartValueManifest. Each request is served with a controller-runtime client that impersonates the API caller, so the in-cluster reads are authorized against the caller's own RBAC. The slow parts (getChart, AppRelease creation) stay in the caller (b3). Bumps resource-metadata to the EditorModel rename. Signed-off-by: Tamal Saha <tamal@appscode.com>
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
Two changes to the
editor.ui.k8s.appscode.comeditor storage:EditorTemplate→EditorModel(resourceeditormodels), matching editor: rename EditorTemplate to EditorModel kmodules/resource-metadata#656.apirequest.UserFrom→rest.ImpersonationConfig). The in-cluster reads done while reconstructing the editor model (kc.Get(AppRelease)+EditorChartValueManifest) now run as the caller, so they're authorized against the caller's own RBAC instead of the server SA.The storage still only does fast in-cluster reads from the request's chart
values; the slow parts (getChart, AppRelease creation) remain in the caller (b3).Depends on
Related: appscode-cloud/b3#1527, kubeops/installer#494.