kubernetes / sample-controller

Repository for sample controller. Complements sample-apiserver
Apache License 2.0
3.17k stars 1.1k forks source link

README is wrong on generating code when using Go modules #81

Closed ecejjar closed 2 years ago

ecejjar commented 3 years ago

The README.md file reads, when discussing code generation using Go 1.11 modules:

"When using go 1.11 modules (GO111MODULE=on), issue the following commands --- starting in whatever working directory you like."

However, when calling the code generator (downloaded e.g. using go mod vendor), it expects your code to be in the proper Go package path:

jjarauz@javier-XPS:~/git/ccpcontroller$ ./hack/update-codegen.sh
Generating deepcopy funcs
F0920 10:49:58.455671 2562719 main.go:80] Error: Failed executing generator: some packages had errors:
errors in package "github.com/ecejjar/ccpcontroller/pkg/apis/ccpcontroller/v1alpha1":
open ../../../github.com/ecejjar/ccpcontroller/pkg/apis/ccpcontroller/v1alpha1/zz_generated.deepcopy.go: no such file or directory

So , you can't start in whatever working directory you like; you must clone your code in a Go package-like path.

akhil-rane commented 2 years ago

I am getting the same issue, not able to generate code when working directory is outside GOPATH

k8s-triage-robot commented 2 years ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot commented 2 years ago

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

k8s-triage-robot commented 2 years ago

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

k8s-ci-robot commented 2 years ago

@k8s-triage-robot: Closing this issue.

In response to [this](https://github.com/kubernetes/sample-controller/issues/81#issuecomment-1126313129): >The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. > >This bot triages issues and PRs according to the following rules: >- After 90d of inactivity, `lifecycle/stale` is applied >- After 30d of inactivity since `lifecycle/stale` was applied, `lifecycle/rotten` is applied >- After 30d of inactivity since `lifecycle/rotten` was applied, the issue is closed > >You can: >- Reopen this issue or PR with `/reopen` >- Mark this issue or PR as fresh with `/remove-lifecycle rotten` >- Offer to help out with [Issue Triage][1] > >Please send feedback to sig-contributor-experience at [kubernetes/community](https://github.com/kubernetes/community). > >/close > >[1]: https://www.kubernetes.dev/docs/guide/issue-triage/ Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.