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 1f69431 commit 5d0f6ff
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions hack/update-codegen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,17 @@ 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/metrics"

# we skip informers and listers for metrics, because we don't quite support the requisite operations yet
# we skip generating the internal clientset as it's not really needed

kube::codegen::gen_helpers \
--input-pkg-root k8s.io/metrics/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 \
--input-pkg-root k8s.io/metrics/pkg/apis \
--output-pkg-root k8s.io/metrics/pkg/client \
--output-base "$(dirname "${BASH_SOURCE[0]}")/../../.." \
--boilerplate "${SCRIPT_ROOT}/hack/boilerplate.go.txt"
--output-dir "${SCRIPT_ROOT}/pkg/client" \
--output-pkg "${THIS_PKG}/pkg/client" \
--boilerplate "${SCRIPT_ROOT}/hack/boilerplate.go.txt" \
"${SCRIPT_ROOT}/pkg/apis"

0 comments on commit 5d0f6ff

Please sign in to comment.