k8s-openapi
k8s-openapi copied to clipboard
Instructions for modification
Hey, I was looking at adding specta Types to the generated client but I'm not seeing docs for where I could go about adding it.
Is there any way I could get some direction on where to look or how to go about doing this? Sorry if this is obvious, I'm newer to rust.
Your link seems to be for something that generates JS equivalents of Rust types for use with some kind of GUI framework. What exactly are you looking for in k8s-openapi?
If you want to use Kubernetes types in your JS you should probably use the Kubernetes JS client directly.
Yeah, it’s for generating types to be used by a typescript client (more languages are planned too) but I’d like to interact with my clusters from the rust backend for some performant additional functionality.
It enables the RPC to be strongly typed without additional configuration. (Specta supports more than just Tauri (the gui framework) so it would enable strongly typed axum/actix/etc clients as well)
Just wasn’t sure if it would be non-trivial for me to modify the codegen to add that support in a fork.
Yes, so I'm saying that what you would get from that exercise would be equivalent to what you already get from the Kubernetes JS client,, eg PodSpec so just use that.
Fair enough. I'll have to define custom types for responses from my app that aren't just direct Kubernetes queries but that's not the end of the world.