Skip to content

Commit 7e70e35

Browse files
thockink8s-publishing-bot
authored andcommitted
Make code-gen subprojects work on gengo/v2
Kubernetes-commit: f772410082b2bf4e93cfabcf5d9c60f213e88cc7
1 parent 9ac16f8 commit 7e70e35

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

hack/update-codegen.sh

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,15 @@ CODEGEN_PKG=${CODEGEN_PKG:-$(cd "${SCRIPT_ROOT}"; ls -d -1 ./vendor/k8s.io/code-
2323

2424
source "${CODEGEN_PKG}/kube_codegen.sh"
2525

26-
# generate the code with:
27-
# --output-base because this script should also be able to run inside the vendor dir of
28-
# k8s.io/kubernetes. The output-base is needed for the generators to output into the vendor dir
29-
# instead of the $GOPATH directly. For normal projects this can be dropped.
26+
THIS_PKG="k8s.io/sample-controller"
3027

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

3632
kube::codegen::gen_client \
3733
--with-watch \
38-
--input-pkg-root k8s.io/sample-controller/pkg/apis \
39-
--output-pkg-root k8s.io/sample-controller/pkg/generated \
40-
--output-base "$(dirname "${BASH_SOURCE[0]}")/../../.." \
41-
--boilerplate "${SCRIPT_ROOT}/hack/boilerplate.go.txt"
34+
--output-dir "${SCRIPT_ROOT}/pkg/generated" \
35+
--output-pkg "${THIS_PKG}/pkg/generated" \
36+
--boilerplate "${SCRIPT_ROOT}/hack/boilerplate.go.txt" \
37+
"${SCRIPT_ROOT}/pkg/apis"

0 commit comments

Comments
 (0)