From eb6fa1855a4fcc18bd5b05cc4a14d207fccda91a Mon Sep 17 00:00:00 2001 From: danielqsj Date: Mon, 28 Jan 2019 11:32:42 +0800 Subject: [PATCH] remove GOFLAGS and fix quota style --- .../k8s.io/code-generator/generate-groups.sh | 14 ++++++------- .../generate-internal-groups.sh | 20 +++++++++---------- .../code-generator/hack/update-codegen.sh | 2 +- .../code-generator/hack/verify-codegen.sh | 6 +++--- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/staging/src/k8s.io/code-generator/generate-groups.sh b/staging/src/k8s.io/code-generator/generate-groups.sh index bc6e9c3d83d..d82002ddafd 100755 --- a/staging/src/k8s.io/code-generator/generate-groups.sh +++ b/staging/src/k8s.io/code-generator/generate-groups.sh @@ -50,7 +50,7 @@ shift 4 # To support running this script from anywhere, we have to first cd into this directory # so we can install the tools. cd "$(dirname "${0}")" - go install ${GOFLAGS:+${GOFLAGS[@]}} ./cmd/{defaulter-gen,client-gen,lister-gen,informer-gen,deepcopy-gen} + go install ./cmd/{defaulter-gen,client-gen,lister-gen,informer-gen,deepcopy-gen} ) function codegen::join() { local IFS="$1"; shift; echo "$*"; } @@ -68,25 +68,25 @@ done if [ "${GENS}" = "all" ] || grep -qw "deepcopy" <<<"${GENS}"; then echo "Generating deepcopy funcs" - "${GOPATH}"/bin/deepcopy-gen --input-dirs "$(codegen::join , "${FQ_APIS[@]}")" -O zz_generated.deepcopy --bounding-dirs "${APIS_PKG}" "$@" + "${GOPATH}/bin/deepcopy-gen" --input-dirs "$(codegen::join , "${FQ_APIS[@]}")" -O zz_generated.deepcopy --bounding-dirs "${APIS_PKG}" "$@" fi if [ "${GENS}" = "all" ] || grep -qw "client" <<<"${GENS}"; then echo "Generating clientset for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/${CLIENTSET_PKG_NAME:-clientset}" - "${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}" "$@" + "${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}" "$@" fi if [ "${GENS}" = "all" ] || grep -qw "lister" <<<"${GENS}"; then echo "Generating listers for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/listers" - "${GOPATH}"/bin/lister-gen --input-dirs "$(codegen::join , "${FQ_APIS[@]}")" --output-package "${OUTPUT_PKG}"/listers "$@" + "${GOPATH}/bin/lister-gen" --input-dirs "$(codegen::join , "${FQ_APIS[@]}")" --output-package "${OUTPUT_PKG}/listers" "$@" fi if [ "${GENS}" = "all" ] || grep -qw "informer" <<<"${GENS}"; then echo "Generating informers for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/informers" - "${GOPATH}"/bin/informer-gen \ + "${GOPATH}/bin/informer-gen" \ --input-dirs "$(codegen::join , "${FQ_APIS[@]}")" \ --versioned-clientset-package "${OUTPUT_PKG}/${CLIENTSET_PKG_NAME:-clientset}/${CLIENTSET_NAME_VERSIONED:-versioned}" \ - --listers-package "${OUTPUT_PKG}"/listers \ - --output-package "${OUTPUT_PKG}"/informers \ + --listers-package "${OUTPUT_PKG}/listers" \ + --output-package "${OUTPUT_PKG}/informers" \ "$@" fi diff --git a/staging/src/k8s.io/code-generator/generate-internal-groups.sh b/staging/src/k8s.io/code-generator/generate-internal-groups.sh index 2ab52de33f7..258b53b56f8 100755 --- a/staging/src/k8s.io/code-generator/generate-internal-groups.sh +++ b/staging/src/k8s.io/code-generator/generate-internal-groups.sh @@ -47,7 +47,7 @@ EXT_APIS_PKG="$4" GROUPS_WITH_VERSIONS="$5" shift 5 -go install ${GOFLAGS:+${GOFLAGS[@]}} ./"$(dirname "${0}")"/cmd/{defaulter-gen,conversion-gen,client-gen,lister-gen,informer-gen,deepcopy-gen} +go install ./"$(dirname "${0}")"/cmd/{defaulter-gen,conversion-gen,client-gen,lister-gen,informer-gen,deepcopy-gen} function codegen::join() { local IFS="$1"; shift; echo "$*"; } # enumerate group versions @@ -71,40 +71,40 @@ done if [ "${GENS}" = "all" ] || grep -qw "deepcopy" <<<"${GENS}"; then echo "Generating deepcopy funcs" - "${GOPATH}"/bin/deepcopy-gen --input-dirs "$(codegen::join , "${ALL_FQ_APIS[@]}")" -O zz_generated.deepcopy --bounding-dirs "${INT_APIS_PKG}","${EXT_APIS_PKG}" "$@" + "${GOPATH}/bin/deepcopy-gen" --input-dirs "$(codegen::join , "${ALL_FQ_APIS[@]}")" -O zz_generated.deepcopy --bounding-dirs "${INT_APIS_PKG},${EXT_APIS_PKG}" "$@" fi if [ "${GENS}" = "all" ] || grep -qw "defaulter" <<<"${GENS}"; then echo "Generating defaulters" - "${GOPATH}"/bin/defaulter-gen --input-dirs "$(codegen::join , "${EXT_FQ_APIS[@]}")" -O zz_generated.defaults "$@" + "${GOPATH}/bin/defaulter-gen" --input-dirs "$(codegen::join , "${EXT_FQ_APIS[@]}")" -O zz_generated.defaults "$@" fi if [ "${GENS}" = "all" ] || grep -qw "conversion" <<<"${GENS}"; then echo "Generating conversions" - "${GOPATH}"/bin/conversion-gen --input-dirs "$(codegen::join , "${ALL_FQ_APIS[@]}")" -O zz_generated.conversion "$@" + "${GOPATH}/bin/conversion-gen" --input-dirs "$(codegen::join , "${ALL_FQ_APIS[@]}")" -O zz_generated.conversion "$@" fi if [ "${GENS}" = "all" ] || grep -qw "client" <<<"${GENS}"; then echo "Generating clientset for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/${CLIENTSET_PKG_NAME:-clientset}" if [ -n "${INT_APIS_PKG}" ]; then IFS=" " read -r -a APIS <<< "$(printf '%s/ ' "${INT_FQ_APIS[@]}")" - "${GOPATH}"/bin/client-gen --clientset-name "${CLIENTSET_NAME_INTERNAL:-internalversion}" --input-base "" --input "$(codegen::join , "${APIS[@]}")" --output-package "${OUTPUT_PKG}/${CLIENTSET_PKG_NAME:-clientset}" "$@" + "${GOPATH}/bin/client-gen" --clientset-name "${CLIENTSET_NAME_INTERNAL:-internalversion}" --input-base "" --input "$(codegen::join , "${APIS[@]}")" --output-package "${OUTPUT_PKG}/${CLIENTSET_PKG_NAME:-clientset}" "$@" fi - "${GOPATH}"/bin/client-gen --clientset-name "${CLIENTSET_NAME_VERSIONED:-versioned}" --input-base "" --input "$(codegen::join , "${EXT_FQ_APIS[@]}")" --output-package "${OUTPUT_PKG}/${CLIENTSET_PKG_NAME:-clientset}" "$@" + "${GOPATH}/bin/client-gen" --clientset-name "${CLIENTSET_NAME_VERSIONED:-versioned}" --input-base "" --input "$(codegen::join , "${EXT_FQ_APIS[@]}")" --output-package "${OUTPUT_PKG}/${CLIENTSET_PKG_NAME:-clientset}" "$@" fi if [ "${GENS}" = "all" ] || grep -qw "lister" <<<"${GENS}"; then echo "Generating listers for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/listers" - "${GOPATH}"/bin/lister-gen --input-dirs "$(codegen::join , "${ALL_FQ_APIS[@]}")" --output-package "${OUTPUT_PKG}"/listers "$@" + "${GOPATH}/bin/lister-gen" --input-dirs "$(codegen::join , "${ALL_FQ_APIS[@]}")" --output-package "${OUTPUT_PKG}/listers" "$@" fi if [ "${GENS}" = "all" ] || grep -qw "informer" <<<"${GENS}"; then echo "Generating informers for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/informers" - "${GOPATH}"/bin/informer-gen \ + "${GOPATH}/bin/informer-gen" \ --input-dirs "$(codegen::join , "${ALL_FQ_APIS[@]}")" \ --versioned-clientset-package "${OUTPUT_PKG}/${CLIENTSET_PKG_NAME:-clientset}/${CLIENTSET_NAME_VERSIONED:-versioned}" \ --internal-clientset-package "${OUTPUT_PKG}/${CLIENTSET_PKG_NAME:-clientset}/${CLIENTSET_NAME_INTERNAL:-internalversion}" \ - --listers-package "${OUTPUT_PKG}"/listers \ - --output-package "${OUTPUT_PKG}"/informers \ + --listers-package "${OUTPUT_PKG}/listers" \ + --output-package "${OUTPUT_PKG}/informers" \ "$@" fi diff --git a/staging/src/k8s.io/code-generator/hack/update-codegen.sh b/staging/src/k8s.io/code-generator/hack/update-codegen.sh index 402c9c9aef9..89d84da4109 100755 --- a/staging/src/k8s.io/code-generator/hack/update-codegen.sh +++ b/staging/src/k8s.io/code-generator/hack/update-codegen.sh @@ -30,7 +30,7 @@ set -o pipefail k8s.io/code-generator/_examples/crd k8s.io/code-generator/_examples/crd/apis \ "example:v1 example2:v1" \ --output-base "$(dirname "${BASH_SOURCE[0]}")/../../.." - "$(dirname "${BASH_SOURCE[0]}")"/../generate-groups.sh all \ +"$(dirname "${BASH_SOURCE[0]}")"/../generate-groups.sh all \ k8s.io/code-generator/_examples/MixedCase k8s.io/code-generator/_examples/MixedCase/apis \ "example:v1" \ --output-base "$(dirname "${BASH_SOURCE[0]}")/../../.." diff --git a/staging/src/k8s.io/code-generator/hack/verify-codegen.sh b/staging/src/k8s.io/code-generator/hack/verify-codegen.sh index 0e069df68c7..a03412c42f0 100755 --- a/staging/src/k8s.io/code-generator/hack/verify-codegen.sh +++ b/staging/src/k8s.io/code-generator/hack/verify-codegen.sh @@ -49,6 +49,6 @@ fi # smoke test echo "Smoke testing _example by compiling..." -go build ./"${SCRIPT_ROOT}"/_examples/crd/... -go build ./"${SCRIPT_ROOT}"/_examples/apiserver/... -go build ./"${SCRIPT_ROOT}"/_examples/MixedCase/... +go build "./${SCRIPT_ROOT}/_examples/crd/..." +go build "./${SCRIPT_ROOT}/_examples/apiserver/..." +go build "./${SCRIPT_ROOT}/_examples/MixedCase/..."