cnoe-io / idpbuilder

Spin up a complete internal developer platform with only Docker required as a dependency.
https://cloud-native.slack.com/archives/C05TN9WFN5S
Apache License 2.0
150 stars 45 forks source link

`controller-gen` Fails to Generate Manifests: "no Go files in ./api" Error #329

Open sayandas1 opened 3 days ago

sayandas1 commented 3 days ago

What is your environment, configuration, and command?

Environment:

Operating System: Windows 11 Shell: Git Bash Go version: 1.20.x

Configuration:

Makefile Configuration: The Makefile contains targets for building the project, formatting code, running tests, generating manifests, and more. Key parts of the Makefile related to this issue are: makefile manifests: controller-gen $(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./api/..." output:crd:artifacts:config=pkg/controllers/resources

controller-gen: $(CONTROLLER_GEN) $(CONTROLLER_GEN): $(LOCALBIN) test -s $(LOCALBIN)/controller-gen && $(LOCALBIN)/controller-gen --version | grep -q $(CONTROLLER_TOOLS_VERSION) || \ GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_TOOLS_VERSION)

Command Execution:

I am executing the make build command from Git Bash in the project directory. I use Git Bash on Windows 11 to execute shell commands. Navigate to the Project Directory. Run the Build Command: make build

What did you do and What did you see instead?

$ make build mkdir -p /c/Users/dassa/Downloads/adhar-main/adhar/bin test -s /c/Users/dassa/Downloads/adhar-main/adhar/bin/controller-gen && /c/Users/dassa/Downloads/adhar-main/adhar/bin/controller-gen --version | grep -q v0.14.0 || \ GOBIN=/c/Users/dassa/Downloads/adhar-main/adhar/bin go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.14.0 /c/Users/dassa/Downloads/adhar-main/adhar/bin/controller-gen rbac:roleName=manager-role crd webhook paths="./api/..." output:crd:artifacts:config=pkg/controllers/resources -: no Go files in C:\Users\dassa\Downloads\adhar-main\adhar\api Error: not all generators ran successfully run controller-gen rbac:roleName=manager-role crd webhook paths=./api/... output:crd:artifacts:config=pkg/controllers/resources -w to see all available markers, or controller-gen rbac:roleName=manager-role crd webhook paths=./api/... output:crd:artifacts:config=pkg/controllers/resources -h for usage make: *** [Makefile:57: manifests] Error 1

Additional Information. Logs.

No response

nabuskey commented 2 days ago

Hey @sayandas1, thanks for opening this issue.

I have not done any development work on Windows so I am not sure what went wrong. My guess is git bash is not truly compatible with what we expect things to work on Linux system. I think your best bet is to use WSL instead.