controller-tools icon indicating copy to clipboard operation
controller-tools copied to clipboard

Error loading module dependency packages while running manifests command with controller-gen v0.12.0

Open gouravganguly opened this issue 2 years ago • 21 comments

Golang version: 1.20.6 CONTROLLER_TOOLS_VERSION ?= v0.12.0

Error
/workspace/bin/controller-gen rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases
Error: load packages in root "/workspace/.bob/gopath/pkg/mod/gopkg.in/[email protected]": err: exit status 1: stderr: go: gopkg.in/[email protected]: missing go.sum entry for go.mod file; to add it:
	go mod download gopkg.in/check.v1
go: gopkg.in/[email protected]: missing go.sum entry for go.mod file; to add it:
	go mod download gopkg.in/check.v1
Makefile commands
.PHONY: controller-gen
controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessary. If wrong version is installed, it will be overwritten.
$(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)

.PHONY: manifests
manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
	$(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases

Even after running the go mod download it doesn't work either. Tried running the command locally, it doesn't work either. v0.6.0 is working with no issues but when updated to v0.12.0 seeing these issues. Please provide some feedback and let me know if you need more details. Thanks!

gouravganguly avatar Aug 18 '23 13:08 gouravganguly