-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resource schema #139
Resource schema #139
Conversation
3cf0900
to
e683831
Compare
e683831
to
97bb45a
Compare
108d104
to
d121dfe
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @MbolotSuse, tons of great work here - I feel confident this will help significantly in the performance of cases we've observed.
I put a couple hours understanding context and code - I admit this is not a very deep review, as I lacked and still lack a lot of insight. Hopefully comments will still help in some way.
Looking forward to see this tested in the UI!
697db4f
to
0e49474
Compare
|
||
addBaseSchema("management.cattle.io.globalrole", "management.cattle.io.missingfrommodel") | ||
|
||
tests := []struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we could have a couple more tests wrt. resource version:
- resource.Version == ""
- resource.Version == group.Version
- resource.Version != group.Version
to make sure we properly handle these cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can look into adding this as a part of MbolotSuse#1
Changes steve to only return top level schema definitions rather than a full defined schema for every field. Also adds basic docs and fixes a bug with schema generation on versioned crds
Introduces new schema definitions endpoint, allowing the caller to get the fields/types/descriptions for a given kubernetes resource.
0e49474
to
099ebc5
Compare
Overview
Related to rancher/rancher#41301. Also see the previous pr #62 for some earlier discussion and context.
Currently, the steve schemas endpoint produces an extremely large amount of data. Since the UI needs this endpoint for a variety of reasons and frequently fetches the entirety of it, this produces a large performance impact where pages will need to wait a significant amount of time, purely for the schemas to load.
This PR reduces the amount of schemas, and causes (most of) the schemas to have no
resourceField
. In addition, it introduces a newschemaDefinitions
endpoint which provides all fields/types/descriptions for a single schema.Solution Detail
Pod
would be included, but there is no longer a schema for thePodSpec
.resourceFields
from the schemas.schemaDefinitions
endpoint which allows users to specify a single schema (i.e.Pod
) and provides the full resource fields for that schema./v1/schemaDefinitions
will return an error). This was done to encourage use of only a specific resource definition at a time - the full openapi schema for k8s is still quite large, and this could cause large performance drops if a list was supported.Pod
includesPodSpec
, this endpoint will return the top-level fields for bothPod
andPodSpec
.schemas
endpoint. In short, if you can see theschema
for an object, you can get it'sschemaDefinition
as well.openapiv2
part of the schema retrieval to only add description (previously this was used for resource fields).schemaFieldVisitor
which translates from an openapi schema to a schema definition.Notes