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

Ignore internals types #286

Closed
tamalsaha opened this issue Jul 26, 2019 · 4 comments · Fixed by #325
Closed

Ignore internals types #286

tamalsaha opened this issue Jul 26, 2019 · 4 comments · Fixed by #325
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@tamalsaha
Copy link
Contributor

We have a repo where where one apigroup uses EAS and other api groups use CRD. We are trying to use controller-gen to generate CRD yamls. But it fails with an error like below:

Generating CRD manifests
/go/src/stash.appscode.dev/stash/apis/repositories/types.go:28:2: enountered struct field "" without JSON tag in type "Snapshot"
/go/src/stash.appscode.dev/stash/apis/repositories/types.go:29:2: enountered struct field "" without JSON tag in type "Snapshot"
/go/src/stash.appscode.dev/stash/apis/repositories/types.go:30:2: enountered struct field "Status" without JSON tag in type "Snapshot"
stash.appscode.dev/stash/apis/repositories:-: CRD for Snapshot.repositories.stash.appscode.com has no storage version
stash.appscode.dev/stash/apis/repositories/v1alpha1:-: conflicting types in allOf branches in schema: array vs object
Error: not all generators ran successfully
Usage:
  controller-gen [flags]

You can see the change here: stashed/stash#843

How can this be fixed?

@tamalsaha
Copy link
Contributor Author

@droot / @DirectXMan12 , can this issue get some love? We are looking to use Kubebuilder for the new CRD GA features. This is a blocker for us adopting Kubebuilder.

@DirectXMan12
Copy link
Contributor

hey, sorry, somehow I missed this in my normal triage

It should be possible to skip internal packages. I'd be in favor of having a marker that indicated internal packages or whatever.

Are you willing to submit a PR? It should be a pretty simple PR -- you'll need to change the logic in "pkg/crd/parser".Parser.indexTypes that populates the group-version for each package to skip internal packages using the marker.

@DirectXMan12
Copy link
Contributor

/kind feature

@k8s-ci-robot k8s-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Sep 20, 2019
@tamalsaha
Copy link
Contributor Author

tamalsaha commented Sep 21, 2019

@DirectXMan12 , I took an attempt at implementing this feature #325 . PTAL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants