-
-
Notifications
You must be signed in to change notification settings - Fork 325
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
openapi gen standardisation pre-donation #606
Comments
(This doesn't apply to us at all because a naively generated official client won't be helpful. I also don't know if official clients in other languages are used like that.) What they have in mind is more towards
I haven't looked into It'll be awkward (and pointless) to call
Can add an option to generate from a file instead, and read the patched file. But again, it's awkward and pointless. Also,
There's only one fix up they benefit from at the moment because they don't backport fixes, and everything else is fixed in 1.22. For that one, downloading and patching curl -sSL $SWAGGER_URL \
| gron \
| perl -pe 's/(?<=kind = ")(Pod|Node|Service)(?:Attach|Exec|PortForward|Proxy)Options(?=")/$1/' \
| gron -u \
> swagger.json |
See #371 (comment) for the default |
I do think they kind of illustrate how difficult it is to use a basic client inside an advanced one by the existence of kubernetes-client/go vs. kubernetes/client-go. It's hard to slot these things together, and this goes doubly in rust where the ecosystem has moved so fast with dependencies and the ways best practice clients have been going. Anyway, their justification aside, some of the dedicated clients DO manage to do a bit of generic stuff on top of the generation. So it's possible that the |
Still, it'd be a CI nightmare to have |
Closing this for now as it's no longer a requirement for donation (and that's why it was openend). That said, we are working on the protobuf issue #371 in the https://github.com/kube-rs/k8s-pb repo. |
Continuation of comments from the root issue around
gen
,k8s-openapi
, kubernetes' desire to centralise as much of the code gen as possible.This meant to be the key points. Please comment if I am missing some details or am getting something wrong here. Trying to use this to link to in the greater discussion.
Highlighted comments:
Points
k8s-openapi
does withgen
's client-generator setup that's containerisedk8s-openapi
needs to pick up on it anywaygen
repo (awkward repo step for a curl | patch)k8s-openapi
would still need to patch afterwards for rust specificsProto
We could potentially look at starting in
gen
forproto
in #371 (if arnavion's right it might render the patchup stage less needed).protoc
does not support rust out of the box so we'd have to just bail out after downloading (and maybe patching), and then rely onprost
(leaving thegen
repo, yet again, as an awkward layer of indirection)k8s-openapi
can be re-usedk8s-openapi
outputOptions
gen
foropenapi
and bailing early: does not feel great for us, and might not feel great for them either (esp. if we avoid 95% of their code)gen
for aproto
exploration in protobuf encoding exploration #371 is something we wanted to try anyway (might be beneficial for both parties)gen
to download and patch the swagger might be an alternative way to avoid the awkward repo dependency stepThe text was updated successfully, but these errors were encountered: