Make update-codegen defaulter work on gengo/v2

This commit is contained in:
Tim Hockin 2023-12-29 15:08:04 -08:00
parent 1fb4e824ba
commit 8420278c7f
No known key found for this signature in database

View File

@ -339,7 +339,7 @@ function codegen::prerelease() {
# for having a defaulter generated # for having a defaulter generated
function codegen::defaults() { function codegen::defaults() {
# Build the tool. # Build the tool.
GO111MODULE=on GOPROXY=off go install \ GOPROXY=off go install \
k8s.io/code-generator/cmd/defaulter-gen k8s.io/code-generator/cmd/defaulter-gen
# The result file, in each pkg, of defaulter generation. # The result file, in each pkg, of defaulter generation.
@ -364,7 +364,7 @@ function codegen::defaults() {
local tag_pkgs=() local tag_pkgs=()
for dir in "${tag_dirs[@]}"; do for dir in "${tag_dirs[@]}"; do
tag_pkgs+=("${PRJ_SRC_PATH}/$dir") tag_pkgs+=("./$dir")
done done
kube::log::status "Generating defaulter code for ${#tag_pkgs[@]} targets" kube::log::status "Generating defaulter code for ${#tag_pkgs[@]} targets"
@ -377,12 +377,11 @@ function codegen::defaults() {
git_find -z ':(glob)**'/"${output_file}.go" | xargs -0 rm -f git_find -z ':(glob)**'/"${output_file}.go" | xargs -0 rm -f
./hack/run-in-gopath.sh "${gen_defaulter_bin}" \ "${gen_defaulter_bin}" \
--v "${KUBE_VERBOSE}" \ --v "${KUBE_VERBOSE}" \
--logtostderr \ --logtostderr \
--go-header-file "${BOILERPLATE_FILENAME}" \ --go-header-file "${BOILERPLATE_FILENAME}" \
--output-file-base "${output_file}" \ --output-file-base "${output_file}" \
$(printf -- " --extra-peer-dirs %s" "${tag_pkgs[@]}") \
$(printf -- " -i %s" "${tag_pkgs[@]}") \ $(printf -- " -i %s" "${tag_pkgs[@]}") \
"$@" "$@"