Skip to content

Commit 9931a2a

Browse files
Fix kube::codegen::gen_client for v0.30
Signed-off-by: Carlos Eduardo Arango Gutierrez <eduardoa@nvidia.com>
1 parent 5244543 commit 9931a2a

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

hack/update_codegen.sh

Lines changed: 11 additions & 11 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,22 +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-
sigs.k8s.io/node-feature-discovery/api/nfd \
54+
${NFD_ROOT}/api/nfd \
6055
--boilerplate ${NFD_ROOT}/hack/boilerplate.go.txt
6156

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

61+
# Switch to work in the api worktree
62+
pushd "${NFD_ROOT}/api/nfd" > /dev/null
63+
6664
kube::codegen::gen_client \
67-
--input-pkg-root sigs.k8s.io/node-feature-discovery/api \
68-
--output-pkg-root sigs.k8s.io/node-feature-discovery/api/generated \
69-
--output-base "${NFD_ROOT}" \
70-
--boilerplate ${NFD_ROOT}/hack/boilerplate.go.txt \
71-
--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)