build: upgrade codegen tooling to the latest version

This includes and is based on the changes of:

https://github.com/rook/rook/pull/14894

Co-authored-by: Blaine Gardner <b.blaine.gardner@gmail.com>
Co-authored-by: subhamkrai <srai@redhat.com>
Signed-off-by: Michael Adam <obnox@samba.org>

Fixes: #14894
(cherry picked from commit 9e725b6214)
This commit is contained in:
Michael Adam authored and Mergify committed 2024-12-05 16:47:57 +00:00
1 parent f450cb783c
commit 32d770818d
89 files changed
+1214 -3412

No files matched your search

+27 -23
View File
@@ -1,4 +1,4 @@
#!/usr/bin/env -S bash -e
#!/usr/bin/env bash
# Copyright 2018 The Rook Authors. All rights reserved.
#
@@ -14,29 +14,33 @@
# See the License for the specific language governing permissions and
# limitations under the License.
GROUP_VERSIONS="ceph.rook.io:v1"
set -o errexit
set -o nounset
set -o pipefail
scriptdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# CODE GENERATION
# we run deepcopy and client,lister,informer generations separately so we can use the flag "--plural-exceptions"
# which is only known by client,lister,informer binary and not the deepcopy binary
base_dir="$(cd "${script_dir}/../.." && pwd)"
# run code deepcopy generation
bash ${CODE_GENERATOR}/generate-groups.sh \
deepcopy \
github.com/rook/rook/pkg/client \
github.com/rook/rook/pkg/apis \
"${GROUP_VERSIONS}" \
--output-base "$(dirname "${BASH_SOURCE[0]}")/../../../../.." \
--go-header-file "${scriptdir}/boilerplate.go.txt"
boilerplate="${base_dir}"/build/codegen/header.txt
# run code client,lister,informer generation
bash ${CODE_GENERATOR}/generate-groups.sh \
client,lister,informer \
github.com/rook/rook/pkg/client \
github.com/rook/rook/pkg/apis \
"${GROUP_VERSIONS}" \
--output-base "$(dirname "${BASH_SOURCE[0]}")/../../../../.." \
--go-header-file "${scriptdir}/boilerplate.go.txt" \
--plural-exceptions "CephNFS:CephNFSes" \
source "${CODE_GENERATOR}/kube_codegen.sh"
(
# because apis is a separate go module, code generation
# must be run from within the corresponding directory.
cd ${base_dir}/pkg/apis
# run code deepcopy generation
kube::codegen::gen_helpers \
--boilerplate "${boilerplate}" \
"${base_dir}/pkg/apis" \
# run code client,lister,informer generation
kube::codegen::gen_client \
--output-dir "${base_dir}/pkg/client" \
--output-pkg "github.com/rook/rook/pkg/client" \
--boilerplate "${boilerplate}" \
--plural-exceptions "CephNFS:CephNFSes" \
--with-watch \
"${base_dir}/pkg/apis"
)