Skip to content

controller-gen doesn't work with k8s.io/apiextensions-apiserver #291

@jiachengxu

Description

@jiachengxu

Hi folks,

I use controller-gen integrated with Kubebuilder to generate RBAC, webhook and CRDs for my project, there is a command called make manifests to run:
controller-gen "crd:trivialVersions=true" rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases
to generate everything, but it doesn't work for me since I have k8s.io/apiextensions-apiserver in my go.mod as a dependency, the following error messages are poping out:
/Users/maxwell/go/pkg/mod/k8s.io/apiextensions-apiserver@v0.0.0-20190409022649-727a075fdec8/pkg/apis/apiextensions/v1beta1/types_jsonschema.go:63:2: enountered struct field "Raw" without JSON tag in type "JSON" /Users/maxwell/go/pkg/mod/k8s.io/apiextensions-apiserver@v0.0.0-20190409022649-727a075fdec8/pkg/apis/apiextensions/v1beta1/types_jsonschema.go:29:24: unsupported type "float64" /Users/maxwell/go/pkg/mod/k8s.io/apiextensions-apiserver@v0.0.0-20190409022649-727a075fdec8/pkg/apis/apiextensions/v1beta1/types_jsonschema.go:31:24: unsupported type "float64" /Users/maxwell/go/pkg/mod/k8s.io/apiextensions-apiserver@v0.0.0-20190409022649-727a075fdec8/pkg/apis/apiextensions/v1beta1/types_jsonschema.go:39:24: unsupported type "float64" /Users/maxwell/go/pkg/mod/k8s.io/apiextensions-apiserver@v0.0.0-20190409022649-727a075fdec8/pkg/apis/apiextensions/v1beta1/types_jsonschema.go:85:2: enountered struct field "Schema" without JSON tag in type "JSONSchemaPropsOrArray" /Users/maxwell/go/pkg/mod/k8s.io/apiextensions-apiserver@v0.0.0-20190409022649-727a075fdec8/pkg/apis/apiextensions/v1beta1/types_jsonschema.go:86:2: enountered struct field "JSONSchemas" without JSON tag in type "JSONSchemaPropsOrArray" /Users/maxwell/go/pkg/mod/k8s.io/apiextensions-apiserver@v0.0.0-20190409022649-727a075fdec8/pkg/apis/apiextensions/v1beta1/types_jsonschema.go:105:2: enountered struct field "Allows" without JSON tag in type "JSONSchemaPropsOrBool" /Users/maxwell/go/pkg/mod/k8s.io/apiextensions-apiserver@v0.0.0-20190409022649-727a075fdec8/pkg/apis/apiextensions/v1beta1/types_jsonschema.go:106:2: enountered struct field "Schema" without JSON tag in type "JSONSchemaPropsOrBool" /Users/maxwell/go/pkg/mod/k8s.io/apiextensions-apiserver@v0.0.0-20190409022649-727a075fdec8/pkg/apis/apiextensions/v1beta1/types_jsonschema.go:127:2: enountered struct field "Schema" without JSON tag in type "JSONSchemaPropsOrStringArray" /Users/maxwell/go/pkg/mod/k8s.io/apiextensions-apiserver@v0.0.0-20190409022649-727a075fdec8/pkg/apis/apiextensions/v1beta1/types_jsonschema.go:128:2: enountered struct field "Property" without JSON tag in type "JSONSchemaPropsOrStringArray" Error: not all generators ran successfully
Any ideas about why this happened?

Thanks,
Jiacheng

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions