gen icon indicating copy to clipboard operation
gen copied to clipboard

Support ad-hoc client generation for CRDs

Open yue9944882 opened this issue 5 years ago • 22 comments

as 1.15's out, users can publish their own openapi spec w/ CRD integration. we should probably refactor the scripts to support ad-hoc client generations.

/cc @brendandburns @roycaihw

yue9944882 avatar Jun 27 '19 09:06 yue9944882

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

fejta-bot avatar Sep 25 '19 09:09 fejta-bot

Stale issues rot after 30d of inactivity. Mark the issue as fresh with /remove-lifecycle rotten. Rotten issues close after an additional 30d of inactivity.

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 rotten

fejta-bot avatar Oct 25 '19 09:10 fejta-bot

Would love to see this done. I'd be happy to help if I can.

zoidyzoidzoid avatar Nov 04 '19 11:11 zoidyzoidzoid

Generating clients for CRDs would be amazing

zoidyzoidzoid avatar Nov 04 '19 11:11 zoidyzoidzoid

Rotten issues close after 30d of inactivity. Reopen the issue with /reopen. Mark the issue as fresh with /remove-lifecycle rotten.

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

fejta-bot avatar Dec 04 '19 11:12 fejta-bot

@fejta-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity. Reopen the issue with /reopen. Mark the issue as fresh with /remove-lifecycle rotten.

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

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

k8s-ci-robot avatar Dec 04 '19 11:12 k8s-ci-robot

/reopen ?

zoidyzoidzoid avatar Dec 09 '19 13:12 zoidyzoidzoid

I think this would be a useful feature.

I recently went down this route, of trying to get this working, and it was painful and required some manual work too: https://github.com/bookingcom/shipper/pull/243

zoidyzoidzoid avatar Dec 09 '19 13:12 zoidyzoidzoid

/reopen

yue9944882 avatar Dec 09 '19 14:12 yue9944882

@yue9944882: Reopened this issue.

In response to this:

/reopen

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

k8s-ci-robot avatar Dec 09 '19 14:12 k8s-ci-robot

@zoidbergwill we had an experimental CRD model generator for java (just generating model would be sufficient b/c we have custom-object api to be the general client) https://github.com/kubernetes-client/java/blob/master/docs/generate-model-from-third-party-resources.md. it will require kubernetes v1.15+ tho. it works for us in production..

yue9944882 avatar Dec 09 '19 14:12 yue9944882

/lifecycle active

yue9944882 avatar Dec 09 '19 14:12 yue9944882

@yue9944882 @zoidbergwill we had success using https://github.com/kubernetes-client/gen/ for our case. we grabbed swagger.json.unprocessed (via 1.15+) and post-processed the spec by hand through gron.

aespinosa avatar Dec 10 '19 02:12 aespinosa

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

fejta-bot avatar Mar 09 '20 02:03 fejta-bot

I had some luck in December, but it was pretty painful. I also ended up doing a bunch of copypasta by hand.

Most of it is documented in https://github.com/bookingcom/shipper/pull/243

zoidyzoidzoid avatar Mar 17 '20 22:03 zoidyzoidzoid

Stale issues rot after 30d of inactivity. Mark the issue as fresh with /remove-lifecycle rotten. Rotten issues close after an additional 30d of inactivity.

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 rotten

fejta-bot avatar Apr 16 '20 22:04 fejta-bot

/remove-lifecycle rotten

palnabarun avatar May 10 '20 02:05 palnabarun

/lifecycle frozen

palnabarun avatar May 10 '20 02:05 palnabarun

UPDATE: for java the CRD models now can also be written manually by properly implementing some interfaces: https://github.com/kubernetes-client/java/pull/1020

yue9944882 avatar Jun 29 '20 03:06 yue9944882

After roughly 1.5 year, is anyone actually working on this issue?

std4453 avatar Feb 18 '22 10:02 std4453

The work on the java client has been pretty active. I'm not sure about other languages though. I guess a status at the main github issue status for other languages would be handy.

aespinosa avatar Feb 18 '22 15:02 aespinosa

I'm looking to generate client-go for CRD, does anyone know of any way?

Have check the https://github.com/kubernetes/code-generator and seems like it's base the golang (mean base on mode of golang, like types.go ) and i just have the CRD files, it's generate from rust.


EDIT: checking the https://github.com/OpenAPITools/openapi-generator

liangyuanpeng avatar Aug 24 '23 08:08 liangyuanpeng