Skip to content

Commit

Permalink
Make code-gen subprojects work on gengo/v2
Browse files Browse the repository at this point in the history
Kubernetes-commit: f772410082b2bf4e93cfabcf5d9c60f213e88cc7
  • Loading branch information
thockin authored and k8s-publishing-bot committed Dec 28, 2023
1 parent 9ac16f8 commit 7e70e35
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions hack/update-codegen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,15 @@ CODEGEN_PKG=${CODEGEN_PKG:-$(cd "${SCRIPT_ROOT}"; ls -d -1 ./vendor/k8s.io/code-

source "${CODEGEN_PKG}/kube_codegen.sh"

# 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.
THIS_PKG="k8s.io/sample-controller"

kube::codegen::gen_helpers \
--input-pkg-root k8s.io/sample-controller/pkg/apis \
--output-base "$(dirname "${BASH_SOURCE[0]}")/../../.." \
--boilerplate "${SCRIPT_ROOT}/hack/boilerplate.go.txt"
--boilerplate "${SCRIPT_ROOT}/hack/boilerplate.go.txt" \
"${SCRIPT_ROOT}/pkg/apis"

kube::codegen::gen_client \
--with-watch \
--input-pkg-root k8s.io/sample-controller/pkg/apis \
--output-pkg-root k8s.io/sample-controller/pkg/generated \
--output-base "$(dirname "${BASH_SOURCE[0]}")/../../.." \
--boilerplate "${SCRIPT_ROOT}/hack/boilerplate.go.txt"
--output-dir "${SCRIPT_ROOT}/pkg/generated" \
--output-pkg "${THIS_PKG}/pkg/generated" \
--boilerplate "${SCRIPT_ROOT}/hack/boilerplate.go.txt" \
"${SCRIPT_ROOT}/pkg/apis"

0 comments on commit 7e70e35

Please sign in to comment.