Skip to content

Commit 35d5121

Browse files
vdemeestertekton-robot
authored andcommitted
Fixing codegen scripts 😅
`go install` install binaries either in `$GOBIN` or `$GOPATH/bin`. This means, you can do a `go install` and *hard code* `$GOPATH/bin` to find the installed binaries. As, in any case, this folder is usually in the `$PATH`, we can just rely on that. Signed-off-by: Vincent Demeester <[email protected]>
1 parent 468235f commit 35d5121

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

‎hack/generate-groups.sh‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ set -o errexit
1818
set -o nounset
1919
set -o pipefail
2020

21+
2122
# generate-groups generates everything for a project with external types only, e.g. a project based
2223
# on CustomResourceDefinitions.
2324

@@ -65,22 +66,22 @@ done
6566

6667
if [ "${GENS}" = "all" ] || grep -qw "deepcopy" <<<"${GENS}"; then
6768
echo "Generating deepcopy funcs for ${GROUPS_WITH_VERSIONS}"
68-
"${GOPATH}/bin/deepcopy-gen" --input-dirs "$(codegen::join , "${FQ_APIS[@]}")" -O zz_generated.deepcopy --bounding-dirs "${APIS_PKG}" "$@"
69+
"deepcopy-gen" --input-dirs "$(codegen::join , "${FQ_APIS[@]}")" -O zz_generated.deepcopy --bounding-dirs "${APIS_PKG}" "$@"
6970
fi
7071

7172
if [ "${GENS}" = "all" ] || grep -qw "client" <<<"${GENS}"; then
7273
echo "Generating clientset for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/${CLIENTSET_PKG_NAME:-clientset}"
73-
"${GOPATH}/bin/client-gen" --clientset-name "${CLIENTSET_NAME_VERSIONED:-versioned}" --input-base "" --input "$(codegen::join , "${FQ_APIS[@]}")" --output-package "${OUTPUT_PKG}/${CLIENTSET_PKG_NAME:-clientset}" "$@"
74+
"client-gen" --clientset-name "${CLIENTSET_NAME_VERSIONED:-versioned}" --input-base "" --input "$(codegen::join , "${FQ_APIS[@]}")" --output-package "${OUTPUT_PKG}/${CLIENTSET_PKG_NAME:-clientset}" "$@"
7475
fi
7576

7677
if [ "${GENS}" = "all" ] || grep -qw "lister" <<<"${GENS}"; then
7778
echo "Generating listers for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/listers"
78-
"${GOPATH}/bin/lister-gen" --input-dirs "$(codegen::join , "${FQ_APIS[@]}")" --output-package "${OUTPUT_PKG}/listers" "$@"
79+
"lister-gen" --input-dirs "$(codegen::join , "${FQ_APIS[@]}")" --output-package "${OUTPUT_PKG}/listers" "$@"
7980
fi
8081

8182
if [ "${GENS}" = "all" ] || grep -qw "informer" <<<"${GENS}"; then
8283
echo "Generating informers for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/informers"
83-
"${GOPATH}/bin/informer-gen" \
84+
"informer-gen" \
8485
--input-dirs "$(codegen::join , "${FQ_APIS[@]}")" \
8586
--versioned-clientset-package "${OUTPUT_PKG}/${CLIENTSET_PKG_NAME:-clientset}/${CLIENTSET_NAME_VERSIONED:-versioned}" \
8687
--listers-package "${OUTPUT_PKG}/listers" \

‎hack/generate-knative.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ if grep -qw "injection" <<<"${GENS}"; then
8282
# Clear old injection
8383
rm -rf ${OUTPUT_PKG}
8484

85-
${GOPATH}/bin/injection-gen \
85+
injection-gen \
8686
--input-dirs $(codegen::join , "${FQ_APIS[@]}") \
8787
--versioned-clientset-package ${VERSIONED_CLIENTSET_PKG} \
8888
--external-versions-informers-package ${EXTERNAL_INFORMER_PKG} \

‎hack/update-codegen.sh‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,17 @@ bash ${REPO_ROOT_DIR}/hack/generate-groups.sh "deepcopy,client,informer,lister"
4141
--go-header-file ${REPO_ROOT_DIR}/hack/boilerplate/boilerplate.go.txt
4242

4343
# Depends on generate-groups.sh to install bin/deepcopy-gen
44-
${GOPATH}/bin/deepcopy-gen \
44+
deepcopy-gen \
4545
-O zz_generated.deepcopy \
4646
--go-header-file ${REPO_ROOT_DIR}/hack/boilerplate/boilerplate.go.txt \
4747
-i github.com/tektoncd/pipeline/pkg/apis/config
4848

49-
${GOPATH}/bin/deepcopy-gen \
49+
deepcopy-gen \
5050
-O zz_generated.deepcopy \
5151
--go-header-file ${REPO_ROOT_DIR}/hack/boilerplate/boilerplate.go.txt \
5252
-i github.com/tektoncd/pipeline/pkg/apis/pipeline/pod
5353

54-
${GOPATH}/bin/deepcopy-gen \
54+
deepcopy-gen \
5555
-O zz_generated.deepcopy \
5656
--go-header-file ${REPO_ROOT_DIR}/hack/boilerplate/boilerplate.go.txt \
5757
-i github.com/tektoncd/pipeline/pkg/apis/resource/v1alpha1/storage

0 commit comments

Comments
 (0)