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

Update-codegen.sh get a wrong package name #19

Open
huangzixun123 opened this issue Mar 4, 2022 · 0 comments
Open

Update-codegen.sh get a wrong package name #19

huangzixun123 opened this issue Mar 4, 2022 · 0 comments

Comments

@huangzixun123
Copy link

huangzixun123 commented Mar 4, 2022

  1. git clone https://github.com/kubernetes/sample-controller
  2. modify the sample-controller to cnat-client-go
  3. modify pkg/apis/samplecontroller to pkg/apis/samplecontroller
  4. modify the hack/update-codegen.sh as following
set -o errexit
set -o nounset
set -o pipefail

SCRIPT_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
CODEGEN_PKG=${CODEGEN_PKG:-$(cd "${SCRIPT_ROOT}"; ls -d -1 ./vendor/k8s.io/code-generator 2>/dev/null || echo ../code-generator)}

# generate the code with:
# --output-base    because this script should also be able to run inside the vendor dir of
#                  k8s.io/kubernetes. The output-base is needed for the generators to output into the vendor dir
#                  instead of the $GOPATH directly. For normal projects this can be dropped.
"${CODEGEN_PKG}"/generate-groups.sh "deepcopy,client,informer,lister" \
  github.com/programming-kubernetes/cnat/cnat-client-go/pkg/generated github.com/programming-kubernetes/cnat/cnat-client-go/pkg/apis \
  cnat:v1alpha1 \
  --output-base "$(dirname "${BASH_SOURCE[0]}")/../../../../.." \
  --go-header-file "${SCRIPT_ROOT}"/hack/boilerplate.go.txt
  1. exec the codegen script
./hack/update-codegen.sh 

but i get a wrong package name, like this,
samplecontrollerv1alpha1 "k8s.io/sample-controller/pkg/apis/cnat/samplecontroller/v1alpha1
could anyone tell me how i can fix this?

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

1 participant