mirror of
https://github.com/kubernetes-sigs/node-feature-discovery.git
synced 2025-03-16 21:38:23 +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:
commit
bb36c21e15
1 changed files with 11 additions and 12 deletions
|
@ -23,7 +23,6 @@ TMP_VENDOR_DIR=gen-vendor
|
||||||
function cleanup() {
|
function cleanup() {
|
||||||
echo "Cleaning up..."
|
echo "Cleaning up..."
|
||||||
rm -rf ${TMP_VENDOR_DIR}
|
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.
|
# We need to clean up the go.mod file since code-generator adds temporary library to the go.mod file.
|
||||||
"${GO_CMD}" mod tidy
|
"${GO_CMD}" mod tidy
|
||||||
}
|
}
|
||||||
|
@ -50,23 +49,23 @@ cd $(dirname ${BASH_SOURCE[0]})/..
|
||||||
|
|
||||||
source "${CODEGEN_PKG}/kube_codegen.sh"
|
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
|
# Generating conversion and defaults functions
|
||||||
kube::codegen::gen_helpers \
|
kube::codegen::gen_helpers \
|
||||||
--input-pkg-root sigs.k8s.io/node-feature-discovery/api/nfd \
|
${NFD_ROOT}/api/nfd \
|
||||||
--output-base "${NFD_ROOT}" \
|
|
||||||
--boilerplate ${NFD_ROOT}/hack/boilerplate.go.txt
|
--boilerplate ${NFD_ROOT}/hack/boilerplate.go.txt
|
||||||
|
|
||||||
# HACK: manually patching the auto-generated code as code-generator cannot
|
# HACK: manually patching the auto-generated code as code-generator cannot
|
||||||
# properly handle deepcopy of MatchExpressionSet.
|
# properly handle deepcopy of MatchExpressionSet.
|
||||||
sed s'/out = new(map\[string\]\*MatchExpression)/out = new(MatchExpressionSet)/' -i api/nfd/v1alpha1/zz_generated.deepcopy.go
|
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 \
|
kube::codegen::gen_client \
|
||||||
--input-pkg-root sigs.k8s.io/node-feature-discovery/api \
|
--with-watch \
|
||||||
--output-pkg-root sigs.k8s.io/node-feature-discovery/api/generated \
|
--output-dir "${NFD_ROOT}/api/generated" \
|
||||||
--output-base "${NFD_ROOT}" \
|
--output-pkg "sigs.k8s.io/node-feature-discovery/api/generated" \
|
||||||
--boilerplate ${NFD_ROOT}/hack/boilerplate.go.txt \
|
--boilerplate "${NFD_ROOT}/hack/boilerplate.go.txt" \
|
||||||
--with-watch
|
${NFD_ROOT}/api
|
||||||
|
|
||||||
|
popd > /dev/null
|
||||||
|
|
Loading…
Add table
Reference in a new issue