Make code-gen subprojects work on gengo/v2

Kubernetes-commit: f772410082b2bf4e93cfabcf5d9c60f213e88cc7
This commit is contained in:
Tim Hockin 2023-12-28 15:58:26 -08:00 committed by Kubernetes Publisher
parent 9ac16f811f
commit 7e70e35059

View File

@ -23,19 +23,15 @@ CODEGEN_PKG=${CODEGEN_PKG:-$(cd "${SCRIPT_ROOT}"; ls -d -1 ./vendor/k8s.io/code-
source "${CODEGEN_PKG}/kube_codegen.sh" source "${CODEGEN_PKG}/kube_codegen.sh"
# generate the code with: THIS_PKG="k8s.io/sample-controller"
# --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.
kube::codegen::gen_helpers \ kube::codegen::gen_helpers \
--input-pkg-root k8s.io/sample-controller/pkg/apis \ --boilerplate "${SCRIPT_ROOT}/hack/boilerplate.go.txt" \
--output-base "$(dirname "${BASH_SOURCE[0]}")/../../.." \ "${SCRIPT_ROOT}/pkg/apis"
--boilerplate "${SCRIPT_ROOT}/hack/boilerplate.go.txt"
kube::codegen::gen_client \ kube::codegen::gen_client \
--with-watch \ --with-watch \
--input-pkg-root k8s.io/sample-controller/pkg/apis \ --output-dir "${SCRIPT_ROOT}/pkg/generated" \
--output-pkg-root k8s.io/sample-controller/pkg/generated \ --output-pkg "${THIS_PKG}/pkg/generated" \
--output-base "$(dirname "${BASH_SOURCE[0]}")/../../.." \ --boilerplate "${SCRIPT_ROOT}/hack/boilerplate.go.txt" \
--boilerplate "${SCRIPT_ROOT}/hack/boilerplate.go.txt" "${SCRIPT_ROOT}/pkg/apis"