mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-31 15:25:57 +00:00
code-generator: fix GOPATH unbound variable
This commit is contained in:
parent
65c09568d1
commit
a6109241a3
@ -54,6 +54,10 @@ shift 5
|
|||||||
GO111MODULE=on go install k8s.io/code-generator/cmd/{defaulter-gen,conversion-gen,client-gen,lister-gen,informer-gen,deepcopy-gen,openapi-gen}
|
GO111MODULE=on go install k8s.io/code-generator/cmd/{defaulter-gen,conversion-gen,client-gen,lister-gen,informer-gen,deepcopy-gen,openapi-gen}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Go installs the above commands to get installed in $GOBIN if defined, and $GOPATH/bin otherwise:
|
||||||
|
GOBIN="$(go env GOBIN)"
|
||||||
|
gobin="${GOBIN:-$(go env GOPATH)/bin}"
|
||||||
|
|
||||||
function codegen::join() { local IFS="$1"; shift; echo "$*"; }
|
function codegen::join() { local IFS="$1"; shift; echo "$*"; }
|
||||||
|
|
||||||
# enumerate group versions
|
# enumerate group versions
|
||||||
@ -75,28 +79,28 @@ done
|
|||||||
|
|
||||||
if [ "${GENS}" = "all" ] || grep -qw "deepcopy" <<<"${GENS}"; then
|
if [ "${GENS}" = "all" ] || grep -qw "deepcopy" <<<"${GENS}"; then
|
||||||
echo "Generating deepcopy funcs"
|
echo "Generating deepcopy funcs"
|
||||||
"${GOPATH}/bin/deepcopy-gen" \
|
"${gobin}/deepcopy-gen" \
|
||||||
--input-dirs "$(codegen::join , "${ALL_FQ_APIS[@]}")" -O zz_generated.deepcopy \
|
--input-dirs "$(codegen::join , "${ALL_FQ_APIS[@]}")" -O zz_generated.deepcopy \
|
||||||
"$@"
|
"$@"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${GENS}" = "all" ] || grep -qw "defaulter" <<<"${GENS}"; then
|
if [ "${GENS}" = "all" ] || grep -qw "defaulter" <<<"${GENS}"; then
|
||||||
echo "Generating defaulters"
|
echo "Generating defaulters"
|
||||||
"${GOPATH}/bin/defaulter-gen" \
|
"${gobin}/defaulter-gen" \
|
||||||
--input-dirs "$(codegen::join , "${EXT_FQ_APIS[@]}")" -O zz_generated.defaults \
|
--input-dirs "$(codegen::join , "${EXT_FQ_APIS[@]}")" -O zz_generated.defaults \
|
||||||
"$@"
|
"$@"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${GENS}" = "all" ] || grep -qw "conversion" <<<"${GENS}"; then
|
if [ "${GENS}" = "all" ] || grep -qw "conversion" <<<"${GENS}"; then
|
||||||
echo "Generating conversions"
|
echo "Generating conversions"
|
||||||
"${GOPATH}/bin/conversion-gen" \
|
"${gobin}/conversion-gen" \
|
||||||
--input-dirs "$(codegen::join , "${ALL_FQ_APIS[@]}")" -O zz_generated.conversion \
|
--input-dirs "$(codegen::join , "${ALL_FQ_APIS[@]}")" -O zz_generated.conversion \
|
||||||
"$@"
|
"$@"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${GENS}" = "all" ] || grep -qw "client" <<<"${GENS}"; then
|
if [ "${GENS}" = "all" ] || grep -qw "client" <<<"${GENS}"; then
|
||||||
echo "Generating clientset for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/${CLIENTSET_PKG_NAME:-clientset}"
|
echo "Generating clientset for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/${CLIENTSET_PKG_NAME:-clientset}"
|
||||||
"${GOPATH}/bin/client-gen" \
|
"${gobin}/client-gen" \
|
||||||
--clientset-name "${CLIENTSET_NAME_VERSIONED:-versioned}" \
|
--clientset-name "${CLIENTSET_NAME_VERSIONED:-versioned}" \
|
||||||
--input-base "" \
|
--input-base "" \
|
||||||
--input "$(codegen::join , "${EXT_FQ_APIS[@]}")" \
|
--input "$(codegen::join , "${EXT_FQ_APIS[@]}")" \
|
||||||
@ -106,7 +110,7 @@ fi
|
|||||||
|
|
||||||
if [ "${GENS}" = "all" ] || grep -qw "lister" <<<"${GENS}"; then
|
if [ "${GENS}" = "all" ] || grep -qw "lister" <<<"${GENS}"; then
|
||||||
echo "Generating listers for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/listers"
|
echo "Generating listers for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/listers"
|
||||||
"${GOPATH}/bin/lister-gen" \
|
"${gobin}/lister-gen" \
|
||||||
--input-dirs "$(codegen::join , "${EXT_FQ_APIS[@]}")" \
|
--input-dirs "$(codegen::join , "${EXT_FQ_APIS[@]}")" \
|
||||||
--output-package "${OUTPUT_PKG}/listers" \
|
--output-package "${OUTPUT_PKG}/listers" \
|
||||||
"$@"
|
"$@"
|
||||||
@ -114,7 +118,7 @@ fi
|
|||||||
|
|
||||||
if [ "${GENS}" = "all" ] || grep -qw "informer" <<<"${GENS}"; then
|
if [ "${GENS}" = "all" ] || grep -qw "informer" <<<"${GENS}"; then
|
||||||
echo "Generating informers for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/informers"
|
echo "Generating informers for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/informers"
|
||||||
"${GOPATH}/bin/informer-gen" \
|
"${gobin}/informer-gen" \
|
||||||
--input-dirs "$(codegen::join , "${EXT_FQ_APIS[@]}")" \
|
--input-dirs "$(codegen::join , "${EXT_FQ_APIS[@]}")" \
|
||||||
--versioned-clientset-package "${OUTPUT_PKG}/${CLIENTSET_PKG_NAME:-clientset}/${CLIENTSET_NAME_VERSIONED:-versioned}" \
|
--versioned-clientset-package "${OUTPUT_PKG}/${CLIENTSET_PKG_NAME:-clientset}/${CLIENTSET_NAME_VERSIONED:-versioned}" \
|
||||||
--listers-package "${OUTPUT_PKG}/listers" \
|
--listers-package "${OUTPUT_PKG}/listers" \
|
||||||
@ -125,7 +129,7 @@ fi
|
|||||||
if [ "${GENS}" = "all" ] || grep -qw "openapi" <<<"${GENS}"; then
|
if [ "${GENS}" = "all" ] || grep -qw "openapi" <<<"${GENS}"; then
|
||||||
echo "Generating OpenAPI definitions for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/openapi"
|
echo "Generating OpenAPI definitions for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/openapi"
|
||||||
declare -a OPENAPI_EXTRA_PACKAGES
|
declare -a OPENAPI_EXTRA_PACKAGES
|
||||||
"${GOPATH}/bin/openapi-gen" \
|
"${gobin}/openapi-gen" \
|
||||||
--input-dirs "$(codegen::join , "${EXT_FQ_APIS[@]}" "${OPENAPI_EXTRA_PACKAGES[@]+"${OPENAPI_EXTRA_PACKAGES[@]}"}")" \
|
--input-dirs "$(codegen::join , "${EXT_FQ_APIS[@]}" "${OPENAPI_EXTRA_PACKAGES[@]+"${OPENAPI_EXTRA_PACKAGES[@]}"}")" \
|
||||||
--input-dirs "k8s.io/apimachinery/pkg/apis/meta/v1,k8s.io/apimachinery/pkg/runtime,k8s.io/apimachinery/pkg/version" \
|
--input-dirs "k8s.io/apimachinery/pkg/apis/meta/v1,k8s.io/apimachinery/pkg/runtime,k8s.io/apimachinery/pkg/version" \
|
||||||
--output-package "${OUTPUT_PKG}/openapi" \
|
--output-package "${OUTPUT_PKG}/openapi" \
|
||||||
|
Loading…
Reference in New Issue
Block a user