1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2024-12-14 11:57:51 +00:00

Merge pull request #1681 from ArangoGutierrez/codegenv1.30

Update update_codegen.sh for v0.30 version of codegen tools
This commit is contained in:
Kubernetes Prow Robot 2024-04-26 10:40:30 -07:00 committed by GitHub
commit bb36c21e15
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -23,7 +23,6 @@ TMP_VENDOR_DIR=gen-vendor
function cleanup() {
echo "Cleaning up..."
rm -rf ${TMP_VENDOR_DIR}
rm sigs.k8s.io
# We need to clean up the go.mod file since code-generator adds temporary library to the go.mod file.
"${GO_CMD}" mod tidy
}
@ -50,23 +49,23 @@ cd $(dirname ${BASH_SOURCE[0]})/..
source "${CODEGEN_PKG}/kube_codegen.sh"
# TODO: https://github.com/kubernetes/code-generator/issues/165 has been closed
# we need to bump the version of code-generator to v0.30.0 once it's released
ln -s .. sigs.k8s.io
# Generating conversion and defaults functions
kube::codegen::gen_helpers \
--input-pkg-root sigs.k8s.io/node-feature-discovery/api/nfd \
--output-base "${NFD_ROOT}" \
${NFD_ROOT}/api/nfd \
--boilerplate ${NFD_ROOT}/hack/boilerplate.go.txt
# HACK: manually patching the auto-generated code as code-generator cannot
# properly handle deepcopy of MatchExpressionSet.
sed s'/out = new(map\[string\]\*MatchExpression)/out = new(MatchExpressionSet)/' -i api/nfd/v1alpha1/zz_generated.deepcopy.go
# Switch to work in the api worktree
pushd "${NFD_ROOT}/api/nfd" > /dev/null
kube::codegen::gen_client \
--input-pkg-root sigs.k8s.io/node-feature-discovery/api \
--output-pkg-root sigs.k8s.io/node-feature-discovery/api/generated \
--output-base "${NFD_ROOT}" \
--boilerplate ${NFD_ROOT}/hack/boilerplate.go.txt \
--with-watch
--with-watch \
--output-dir "${NFD_ROOT}/api/generated" \
--output-pkg "sigs.k8s.io/node-feature-discovery/api/generated" \
--boilerplate "${NFD_ROOT}/hack/boilerplate.go.txt" \
${NFD_ROOT}/api
popd > /dev/null