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

controller-gen command failed while running make (CRD Generation) #353

Open
mhkarimi1383 opened this issue Dec 11, 2024 · 5 comments
Open

Comments

@mhkarimi1383
Copy link
Contributor

What steps did you take and what happened:
[A clear and concise description of what the bug is, and what commands you ran.]

Cloned project and ran make

here is the log

/home/karimi/go/src/github.com/openebs/lvm-localpv/buildscripts/generate-manifests.sh
Error: unable to parse option "crd:trivialVersions=false,preserveUnknownFields=false": [unknown argument "trivialVersions" (at <input>:1:16) extra arguments provided: "false,preserveUnknownFields=false" (at <input>:1:17)]
Usage:
  controller-gen [flags]

Examples:
	# Generate RBAC manifests and crds for all types under apis/,
	# outputting crds to /tmp/crds and everything else to stdout
	controller-gen rbac:roleName=<role name> crd paths=./apis/... output:crd:dir=/tmp/crds output:stdout

	# Generate deepcopy/runtime.Object implementations for a particular file
	controller-gen object paths=./apis/v1beta1/some_types.go

	# Generate OpenAPI v3 schemas for API packages and merge them into existing CRD manifests
	controller-gen schemapatch:manifests=./manifests output:dir=./manifests paths=./pkg/apis/... 

	# Run all the generators for a given project
	controller-gen paths=./apis/...

	# Explain the markers for generating CRDs, and their arguments
	controller-gen crd -ww


Flags:
  -h, --detailed-help count   print out more detailed help
                              (up to -hhh for the most detailed output, or -hhhh for json output)
      --help                  print out usage and a summary of options
      --version               show version
  -w, --which-markers count   print out all markers available with the requested generators
                              (up to -www for the most detailed output, or -wwww for json output)


Options


generators

+webhook[:headerFile=<string>][,year=<string>]                                                                                                                                           package  generates (partial) {Mutating,Validating}WebhookConfiguration objects.                        
+schemapatch[:generateEmbeddedObjectMeta=<bool>],manifests=<string>[,maxDescLen=<int>]                                                                                                   package  patches existing CRDs with new schemata.                                                      
+rbac[:headerFile=<string>],roleName=<string>[,year=<string>]                                                                                                                            package  generates ClusterRole objects.                                                                
+object[:headerFile=<string>][,year=<string>]                                                                                                                                            package  generates code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.  
+crd[:allowDangerousTypes=<bool>][,crdVersions=<[]string>][,generateEmbeddedObjectMeta=<bool>][,headerFile=<string>][,ignoreUnexportedFields=<bool>][,maxDescLen=<int>][,year=<string>]  package  generates CustomResourceDefinition objects.                                                   


generic

+paths=<[]string>  package  represents paths and go-style path patterns to use as package roots.   


output rules (optionally as output:<generator>:...)

+output:artifacts[:code=<string>],config=<string>  package  outputs artifacts to different locations, depending on whether they're package-associated or not.   
+output:dir=<string>                               package  outputs each artifact to the given directory, regardless of if it's package-associated or not.      
+output:none                                       package  skips outputting anything.                                                                          
+output:stdout                                     package  outputs everything to standard-out, with no separation.                                             

run `controller-gen crd:trivialVersions=false,preserveUnknownFields=false paths=./pkg/apis/... output:crd:artifacts:config=deploy/yamls -w` to see all available markers, or `controller-gen crd:trivialVersions=false,preserveUnknownFields=false paths=./pkg/apis/... output:crd:artifacts:config=deploy/yamls -h` for usage
make: *** [Makefile:210: manifests] Error 1

What did you expect to happen:

build project and generate manifests after build

The output of the following commands will help us better understand what's going on:
(Pasting long output into a GitHub gist or other Pastebin is fine.)

  • kubectl logs -f openebs-lvm-localpv-controller-7b6d6b4665-fk78q -n openebs -c openebs-lvm-plugin
  • kubectl logs -f openebs-lvm-localpv-node-[xxxx] -n openebs -c openebs-lvm-plugin
  • kubectl get pods -n openebs
  • kubectl get lvmvol -A -o yaml

Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]

Environment:

  • LVM Driver version
  • Kubernetes version (use kubectl version): v1.31.2
  • Kubernetes installer & version:
    controller-get Version: v0.12.0
    Go version: 1.23.3
  • Cloud provider or hardware configuration:
  • OS (e.g. from /etc/os-release): nixos
@dsharma-dc
Copy link
Contributor

I'm guessing this is done from nix-shell. Could be version incompatibilities and not product issue here.

@mhkarimi1383
Copy link
Contributor Author

@dsharma-dc
There is no documentation about the correct version of controller-gen cli

@dsharma-dc
Copy link
Contributor

@dsharma-dc There is no documentation about the correct version of controller-gen cli

The version currently getting installed via Makefile is controller-gen@v0.4.0

@mhkarimi1383
Copy link
Contributor Author

I have to look to see if I can customize it or find an older version

@mhkarimi1383
Copy link
Contributor Author

Fixed by installing the correct version, but the correct version is a bit old :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants