Closed HendrikLeier closed 8 months ago
I believe I've figured it out. It's all in the paths. You can use the sample controller as an example.
By digging around this part of the script you will realize that the path where the codegen will run depends on the parameters you set as --input-pkg-root, --output-base
.
Long story short:
${HOME}/${GO_PACKAGE_NAME}
. So if your package is github.com/foo/bar
, then the path should be /home/${USER}/github.com/foo/bar
/
, i.e. k8s.io/sample-controller
. If your package (most likely) is called github.com/foo/bar
, then the package name has 3 parts. This means you need to add one more ..
to your output base: --output-base "$(dirname "${BASH_SOURCE[0]}")/../../.."
-> "$(dirname "${BASH_SOURCE[0]}")/../../../.."
You can of course completely override the out base, but the path should still contain the github path.
The Kubernetes project currently lacks enough contributors to adequately respond to all issues.
This bot triages un-triaged issues according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/remove-lifecycle stale
/close
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.
This bot triages un-triaged issues according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/remove-lifecycle rotten
/close
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle rotten
Most of the path weirdness is now fixed.
/close
@thockin: Closing this issue.
When I run the following code:
I get the following error:
I made sure that the directory exists and contains files that are annotated with
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
I tried crafting the
git grep
by hand. That worked, it might be something in the way of how you call git grep.I tried varying the path but that didn't do anything.
I am running in a docker container on
golang:1.20.4-buster
git version is 2.20.1Am I doing something wrong or is this a bug?