Skip to content

Ignore internals types #286

Closed
Closed

Description

@tamalsaha

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?

Activity

  1. tamalsaha commented on Sep 20, 2019

    @tamalsaha
    ContributorAuthor

    @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.

  2. DirectXMan12 commented on Sep 20, 2019

    @DirectXMan12
    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.

  3. DirectXMan12 commented on Sep 20, 2019

    @DirectXMan12
    Contributor

    /kind feature

  4. added
    kind/feature
    on Sep 20, 2019
  5. tamalsaha commented on Sep 21, 2019

    @tamalsaha
    ContributorAuthor

    @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

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions