@@ -23,7 +23,6 @@ TMP_VENDOR_DIR=gen-vendor
23
23
function cleanup() {
24
24
echo " Cleaning up..."
25
25
rm -rf ${TMP_VENDOR_DIR}
26
- rm sigs.k8s.io
27
26
# We need to clean up the go.mod file since code-generator adds temporary library to the go.mod file.
28
27
" ${GO_CMD} " mod tidy
29
28
}
@@ -50,23 +49,23 @@ cd $(dirname ${BASH_SOURCE[0]})/..
50
49
51
50
source " ${CODEGEN_PKG} /kube_codegen.sh"
52
51
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
-
57
52
# Generating conversion and defaults functions
58
53
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 \
61
55
--boilerplate ${NFD_ROOT} /hack/boilerplate.go.txt
62
56
63
57
# HACK: manually patching the auto-generated code as code-generator cannot
64
58
# properly handle deepcopy of MatchExpressionSet.
65
59
sed s' /out = new(map\[string\]\*MatchExpression)/out = new(MatchExpressionSet)/' -i api/nfd/v1alpha1/zz_generated.deepcopy.go
66
60
61
+ # Switch to work in the api worktree
62
+ pushd " ${NFD_ROOT} /api/nfd" > /dev/null
63
+
67
64
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