Skip to content
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

Mix task for generating CRD swagger #26

Closed
coryodaniel opened this issue Jan 12, 2019 · 3 comments
Closed

Mix task for generating CRD swagger #26

coryodaniel opened this issue Jan 12, 2019 · 3 comments

Comments

@coryodaniel
Copy link
Owner

In working on the k8s client I’ve alotted for extending the client with a custom swagger spec.

To auto generate the routes in the client we would need a task that takes a k8s version, downloads the swagger spec, then merged in the swagger operations and definitions for each CRD.

This will allow for simple CRUD style interactions with CRDs in the k8s API.

resources = K8s.list(“mygroup/myversion”, “MyCRDType”)

@coryodaniel
Copy link
Owner Author

In my current testing the process is a little bumpy as it will require two compile passes. One to compile the CRDs so that mix can pick them up and a second to compile the client with the swagger file that mix generates.

@mindreframer
Copy link
Contributor

I have a suggestion (not sure this is related): how about we stick to simple code generation instead of metaprogramming + compilation? This was one of the most irritating things about kazan - there was no code to jump to, you had to lookup things in the console, it was a bit difficult to imagine how the actual code looks like. Granted, this is one of the most cool things Elixir gives - compile-time macros, but everything has a price... Good to see your progress on the k8s client!

@coryodaniel
Copy link
Owner Author

No longer necessary, underlying k8s library does API discovery. Will need to just push the CRD and everything should work fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants