Arnavion / k8s-openapi

Rust definitions of the resource types in the Kubernetes client API
Apache License 2.0
384 stars 41 forks source link

[Question] Difference with kubernetes-client/gen #26

Closed ngortheone closed 5 years ago

ngortheone commented 5 years ago

Hi @Arnavion As I was exploring available options for kubernetes clients for rust I found out that @ynqa in his https://github.com/ynqa/kubernetes-rust/pull/10 is moving away from your library and tries to use https://github.com/kubernetes-client/gen

On the surface it seems like reinvention of the wheel, so I decided find out if there is substantial difference between kubernetes-client/gen and your approach and why kubernetes-client/gen might not want to accept a client that was not generated with their generator.

I believe that you did some kind of research before writing your own generator, so there must reason for that. Could you please share your perspective?

Arnavion commented 5 years ago

Most of the differences amount to this crate doing things specific to Kubernetes's OpenAPI spec that a generic swagger generator does not.

Almost everything in https://github.com/Arnavion/k8s-openapi-codegen/blob/15777b259ac16cc4287da3ede50f62d3c4508be9/src/fixups.rs is what an automatic swagger-generated client gets wrong. You don't have to read the code, just read the comments.

ngortheone commented 5 years ago

Thanks for a very detailed answer!

Does it mean that as official kubernetes-client/gen will get better at handling those issues this repo/crate will become obsolete? (Is there a chance that official gen will become better?)

Separately Would you be interested in a PR with enhancements to readme/docs with this information, and information that I can find in other issues ?( e.g. intended usage : https://github.com/Arnavion/k8s-openapi-codegen/issues/20 https://github.com/Arnavion/k8s-openapi-codegen/issues/24 https://github.com/Arnavion/k8s-openapi-codegen/issues/17 )

Arnavion commented 5 years ago

Does it mean that as official kubernetes-client/gen will get better at handling those issues this repo/crate will become obsolete?

That depends on the effort that that crate puts. You would have to ask its maintainers.

Would you be interested in a PR with enhancements to readme/docs with this information, and information that I can find in other issues ?

Yeah, sure.

Also, thanks for reminding me about #17. I've updated my comment there.

ngortheone commented 5 years ago

Information collected in https://github.com/Arnavion/k8s-openapi-codegen/pull/27