@@ -27,6 +27,7 @@ API_PKGS=${API_PKGS::-1} # remove trailing ","
2727
2828VERSION=$( go list -m k8s.io/api | cut -d ' ' -f2)
2929GOBIN=" $( go env GOBIN) "
30+ gopath=" $( go env GOPATH) "
3031gobin=" ${GOBIN:- $(go env GOPATH)/ bin} "
3132# new version is completly broken (with breaking changes \o/) use old one
3233# go install k8s.io/code-generator/cmd/{deepcopy-gen,register-gen,client-gen,lister-gen,informer-gen,defaulter-gen}@$VERSION
@@ -36,21 +37,21 @@ go install k8s.io/code-generator/cmd/{deepcopy-gen,register-gen,client-gen,liste
3637echo " Generating code for $API_PKGS "
3738
3839echo " Generating deepcopy funcs"
39- " ${gobin} /deepcopy-gen" \
40+ GOPATH= $gopath " ${gobin} /deepcopy-gen" \
4041 -O zz_generated.deepcopy\
4142 --input-dirs ${API_PKGS} \
4243 --go-header-file ${HDR_FILE} \
4344 --output-base ${OUTPUT_DIR}
4445
4546echo " Generating register funcs"
46- " ${gobin} /register-gen" \
47+ GOPATH= $gopath " ${gobin} /register-gen" \
4748 -O zz_generated.register\
4849 --input-dirs ${API_PKGS} \
4950 --go-header-file ${HDR_FILE} \
5051 --output-base ${OUTPUT_DIR}
5152
5253echo " Generating clientset"
53- " ${gobin} /client-gen" \
54+ GOPATH= $gopath " ${gobin} /client-gen" \
5455 --plural-exceptions " Defaults:Defaults" \
5556 --clientset-name " versioned" \
5657 --input ${API_PKGS} \
@@ -60,15 +61,15 @@ echo "Generating clientset"
6061 --output-base ${OUTPUT_DIR}
6162
6263echo " Generating listers"
63- " ${gobin} /lister-gen" \
64+ GOPATH= $gopath " ${gobin} /lister-gen" \
6465 --plural-exceptions " Defaults:Defaults" \
6566 --input-dirs ${API_PKGS} \
6667 --output-package " ${CR_PKG} /generated/listers" \
6768 --go-header-file ${HDR_FILE} \
6869 --output-base ${OUTPUT_DIR}
6970
7071echo " Generating informers"
71- " ${gobin} /informer-gen" \
72+ GOPATH= $gopath " ${gobin} /informer-gen" \
7273 --plural-exceptions " Defaults:Defaults" \
7374 --input-dirs ${API_PKGS} \
7475 --versioned-clientset-package " ${CR_PKG} /generated/clientset/versioned" \
0 commit comments