kubernetes-client / c

Official C client library for Kubernetes
Apache License 2.0
146 stars 46 forks source link

Instructions to running openapi generator #8

Closed jiria closed 3 years ago

jiria commented 4 years ago

Hello,

Can you please provide instructions/script on rerunning the openapi generator? Specifically, trying to target some CRDs with the C client.

ityuhui commented 4 years ago

Hi @jiria

There are 2 methods to re-run the openapi generator.

  1. The official method:
    use the script in https://github.com/kubernetes-client/gen with the configuration https://github.com/kubernetes-client/c/blob/master/settings

  2. After you get the kubernets API specification "swagger.json" by the method 1 you can re-run openapi-generator by this command in openapi-generator directory.

mvn clean package
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -i ${kubernetes-client-c-dir}/kubernetes/swagger.json   -g c    -o ../kubernetes-client-c --skip-validate-spec

You can try it for your case. I have not test for CRD yet. Welcome PR to support CRD!

ityuhui commented 4 years ago

Hi @brendandburns

Do we support to add user's CRD openapi/swagger spec to the swagger.json? by manual or by kubernetes-client/gen ?

Or users only can create/query/update/delete CustomResourceDefinition by kuberntes-client/c They need handle their own CRD model/api by their application ?

ityuhui commented 4 years ago

Hi @jiria

These 2 files maybe useful for you to try.

https://github.com/kubernetes-client/c/blob/master/kubernetes/api/CustomObjectsAPI.h https://github.com/kubernetes-client/c/blob/master/kubernetes/api/CustomObjectsAPI.c

brendandburns commented 4 years ago

There are example instructions here: https://github.com/kubernetes-client/java/blob/master/docs/generate-model-from-third-party-resources.md

For the Java client, we could do something similar for C

fejta-bot commented 4 years ago

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle stale

ityuhui commented 4 years ago

/remove-lifecycle stale

This defect traces the client for CRD.

jiria commented 4 years ago

Thank you for the pointers. I had to switch to the C# SDK due to existing dependencies, so did not really get too far here. But I hope other folks will find this useful as well. Not closing in case you want to track this further.

ityuhui commented 3 years ago

The best method to support CRD is generic client now.

fejta-bot commented 3 years ago

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale

ityuhui commented 3 years ago

/close

k8s-ci-robot commented 3 years ago

@ityuhui: Closing this issue.

In response to [this](https://github.com/kubernetes-client/c/issues/8#issuecomment-796488334): >/close Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.