-
Notifications
You must be signed in to change notification settings - Fork 667
Introduce TS types for OpenShift / KubeVirt #1773
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
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: suomiy The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @suomiy. Thanks for your PR. I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
| vmi?: VMIKind; | ||
| vm: V1VirtualMachine; | ||
| pods?: V1Pod[]; | ||
| migrations?: V1VirtualMachineInstanceMigration[]; |
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.
Otherwise it would be quite tedious to create all the new types.
+ the whole console & other plugins could benefit from the usual openshift objects
|
To see generated example please search for |
|
After offline discussion, it was concluded the best solution would be to have the types in separate package inside the I will start working on introducing such a package together with generation script. |
|
I really like the idea of generating the types so we're always correct and current. Is there a way to improve the names? Names like |
I agree. This is the biggest problem so far. I would prefer to remove the namespacing where possible and leaving only the version, i.e. I already did that for almost all of the types in my repo https://github.com/suomiy/openshift-typescript-api. The main problem is that there are some conflicts ( We could either:
Other problems:I found few type inconsistencies in the kubevirt I will try to find a solution for these. |
|
closing in favor of #1813 |
just a showcase PR: to decide which direction to take:
This adds a complete types with documentation for all kubernetes/openshift/kubevirt objects.
The types are generated (using autorest) from OpenAPI specification taken from
types could live in:
separate repo / npm package (current state)Temporary location athttps://www.npmjs.com/package/kubevirt-typescript-api (https://github.com/suomiy/openshift-typescript-api)https://www.npmjs.com/package/openshift-typescript-api (https://github.com/suomiy/kubevirt-typescript-api)having generation script and their respective folder/s in@console/sharedconsolePlease let me know if somebody has a better alternative where the types could live or how to better approach this issue
this PR showcases the usage in
@kubevirtplugindepends on: