Skip to content
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

Generate json-schema from go types #28

Closed
erictune opened this issue Dec 12, 2017 · 17 comments
Closed

Generate json-schema from go types #28

erictune opened this issue Dec 12, 2017 · 17 comments
Labels
lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness.

Comments

@erictune
Copy link
Member

When you create a CRD, it can have a schema defined using json-schema.

In github.com/kubernetes/sample-controller the client libraries for a controller are generated from a go API definition, and CRDs are created, but there is no schema for the CRD, which means less validation.

It would be nice to generate the json-schema for the CRD from the Go types. So, this is proposing a new generator that generates json-schema for CRDs from go types.

@erictune
Copy link
Member Author

xref kubernetes/sample-controller#2

@nikhita
Copy link
Member

nikhita commented Dec 12, 2017

/cc @sttts @munnerz @mbohlool

@sttts
Copy link
Contributor

sttts commented Dec 12, 2017

@erictune we discussed the very same idea at KubeCon. We have openapi-gen which produces a Golang snippet now which is very similar to a JSON Schema already. @munnerz wanted to prototype a change to openapi-gen with your described goal.

@munnerz
Copy link
Member

munnerz commented Dec 12, 2017

Yep - likely I won't have a chance to get onto this until next week, as this is my final week before xmas. I think @sttts and I discussed initially adding an 'output format' parameter to openapi-gen in order to facilitate this.

@mbohlool
Copy link
Contributor

/assign

@perotinus
Copy link

+1 to this. I'm looking into having the cluster registry be a CRD and this would be a boon for that.

@sttts
Copy link
Contributor

sttts commented Mar 8, 2018

kubernetes/kube-openapi#37 needs review time.

@munnerz
Copy link
Member

munnerz commented Mar 8, 2018 via email

@erictune
Copy link
Member Author

I just came across this which looks similar:
https://github.com/ant31/crd-validation

@lavalamp
Copy link
Member

I expect we will take this on in kube-openapi and not here.

@fejta-bot
Copy link

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

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Sep 9, 2018
@fejta-bot
Copy link

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

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Oct 9, 2018
@nikhita
Copy link
Member

nikhita commented Oct 9, 2018 via email

@k8s-ci-robot k8s-ci-robot added lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. and removed lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. labels Oct 9, 2018
@mbohlool
Copy link
Contributor

/unassign mbohlool

@sttts
Copy link
Contributor

sttts commented Apr 15, 2019

Work on this is going on in http://github.com/kubernetes-sigs/controller-tools.

@thockin
Copy link
Member

thockin commented Mar 12, 2024

/close

stale?

@k8s-ci-robot
Copy link

@thockin: Closing this issue.

In response to this:

/close

stale?

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness.
Projects
None yet
Development

No branches or pull requests

10 participants