Skip to content

Commit bb36c21

Browse files
authored
Merge pull request #1681 from ArangoGutierrez/codegenv1.30
Update update_codegen.sh for v0.30 version of codegen tools
2 parents 122373c + 9931a2a commit bb36c21

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

hack/update_codegen.sh

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ TMP_VENDOR_DIR=gen-vendor
2323
function cleanup() {
2424
echo "Cleaning up..."
2525
rm -rf ${TMP_VENDOR_DIR}
26-
rm sigs.k8s.io
2726
# We need to clean up the go.mod file since code-generator adds temporary library to the go.mod file.
2827
"${GO_CMD}" mod tidy
2928
}
@@ -50,23 +49,23 @@ cd $(dirname ${BASH_SOURCE[0]})/..
5049

5150
source "${CODEGEN_PKG}/kube_codegen.sh"
5251

53-
# TODO: https://github.com/kubernetes/code-generator/issues/165 has been closed
54-
# we need to bump the version of code-generator to v0.30.0 once it's released
55-
ln -s .. sigs.k8s.io
56-
5752
# Generating conversion and defaults functions
5853
kube::codegen::gen_helpers \
59-
--input-pkg-root sigs.k8s.io/node-feature-discovery/api/nfd \
60-
--output-base "${NFD_ROOT}" \
54+
${NFD_ROOT}/api/nfd \
6155
--boilerplate ${NFD_ROOT}/hack/boilerplate.go.txt
6256

6357
# HACK: manually patching the auto-generated code as code-generator cannot
6458
# properly handle deepcopy of MatchExpressionSet.
6559
sed s'/out = new(map\[string\]\*MatchExpression)/out = new(MatchExpressionSet)/' -i api/nfd/v1alpha1/zz_generated.deepcopy.go
6660

61+
# Switch to work in the api worktree
62+
pushd "${NFD_ROOT}/api/nfd" > /dev/null
63+
6764
kube::codegen::gen_client \
68-
--input-pkg-root sigs.k8s.io/node-feature-discovery/api \
69-
--output-pkg-root sigs.k8s.io/node-feature-discovery/api/generated \
70-
--output-base "${NFD_ROOT}" \
71-
--boilerplate ${NFD_ROOT}/hack/boilerplate.go.txt \
72-
--with-watch
65+
--with-watch \
66+
--output-dir "${NFD_ROOT}/api/generated" \
67+
--output-pkg "sigs.k8s.io/node-feature-discovery/api/generated" \
68+
--boilerplate "${NFD_ROOT}/hack/boilerplate.go.txt" \
69+
${NFD_ROOT}/api
70+
71+
popd > /dev/null

0 commit comments

Comments
 (0)