mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-04 18:00:08 +00:00
Adding support for providing version for functions in kube_codegen.sh (#129658)
* adding support for providing version for functions in kube_codegen.sh * addressed review comments * addressed review comments
This commit is contained in:
parent
25be4a4bd4
commit
a78983906f
@ -27,6 +27,11 @@ set -o pipefail
|
|||||||
|
|
||||||
KUBE_CODEGEN_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"
|
KUBE_CODEGEN_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"
|
||||||
|
|
||||||
|
# Callers which want a specific tag of the k8s.io/code-generator repo should
|
||||||
|
# set the KUBE_CODEGEN_TAG to the tag name, e.g. KUBE_CODEGEN_TAG="release-1.32"
|
||||||
|
# before sourcing this file.
|
||||||
|
CODEGEN_VERSION_SPEC="${KUBE_CODEGEN_TAG:+"@${KUBE_CODEGEN_TAG}"}"
|
||||||
|
|
||||||
function kube::codegen::internal::findz() {
|
function kube::codegen::internal::findz() {
|
||||||
# We use `find` rather than `git ls-files` because sometimes external
|
# We use `find` rather than `git ls-files` because sometimes external
|
||||||
# projects use this across repos. This is an imperfect wrapper of find,
|
# projects use this across repos. This is an imperfect wrapper of find,
|
||||||
@ -103,9 +108,9 @@ function kube::codegen::gen_helpers() {
|
|||||||
# and then install with forced module mode on and fully qualified name.
|
# and then install with forced module mode on and fully qualified name.
|
||||||
cd "${KUBE_CODEGEN_ROOT}"
|
cd "${KUBE_CODEGEN_ROOT}"
|
||||||
BINS=(
|
BINS=(
|
||||||
conversion-gen
|
conversion-gen"${CODEGEN_VERSION_SPEC}"
|
||||||
deepcopy-gen
|
deepcopy-gen"${CODEGEN_VERSION_SPEC}"
|
||||||
defaulter-gen
|
defaulter-gen"${CODEGEN_VERSION_SPEC}"
|
||||||
)
|
)
|
||||||
# shellcheck disable=2046 # printf word-splitting is intentional
|
# shellcheck disable=2046 # printf word-splitting is intentional
|
||||||
GO111MODULE=on go install $(printf "k8s.io/code-generator/cmd/%s " "${BINS[@]}")
|
GO111MODULE=on go install $(printf "k8s.io/code-generator/cmd/%s " "${BINS[@]}")
|
||||||
@ -324,7 +329,7 @@ function kube::codegen::gen_openapi() {
|
|||||||
# and then install with forced module mode on and fully qualified name.
|
# and then install with forced module mode on and fully qualified name.
|
||||||
cd "${KUBE_CODEGEN_ROOT}"
|
cd "${KUBE_CODEGEN_ROOT}"
|
||||||
BINS=(
|
BINS=(
|
||||||
openapi-gen
|
openapi-gen"${CODEGEN_VERSION_SPEC}"
|
||||||
)
|
)
|
||||||
# shellcheck disable=2046 # printf word-splitting is intentional
|
# shellcheck disable=2046 # printf word-splitting is intentional
|
||||||
GO111MODULE=on go install $(printf "k8s.io/kube-openapi/cmd/%s " "${BINS[@]}")
|
GO111MODULE=on go install $(printf "k8s.io/kube-openapi/cmd/%s " "${BINS[@]}")
|
||||||
@ -554,10 +559,10 @@ function kube::codegen::gen_client() {
|
|||||||
# and then install with forced module mode on and fully qualified name.
|
# and then install with forced module mode on and fully qualified name.
|
||||||
cd "${KUBE_CODEGEN_ROOT}"
|
cd "${KUBE_CODEGEN_ROOT}"
|
||||||
BINS=(
|
BINS=(
|
||||||
applyconfiguration-gen
|
applyconfiguration-gen"${CODEGEN_VERSION_SPEC}"
|
||||||
client-gen
|
client-gen"${CODEGEN_VERSION_SPEC}"
|
||||||
informer-gen
|
informer-gen"${CODEGEN_VERSION_SPEC}"
|
||||||
lister-gen
|
lister-gen"${CODEGEN_VERSION_SPEC}"
|
||||||
)
|
)
|
||||||
# shellcheck disable=2046 # printf word-splitting is intentional
|
# shellcheck disable=2046 # printf word-splitting is intentional
|
||||||
GO111MODULE=on go install $(printf "k8s.io/code-generator/cmd/%s " "${BINS[@]}")
|
GO111MODULE=on go install $(printf "k8s.io/code-generator/cmd/%s " "${BINS[@]}")
|
||||||
@ -729,7 +734,7 @@ function kube::codegen::gen_register() {
|
|||||||
# and then install with forced module mode on and fully qualified name.
|
# and then install with forced module mode on and fully qualified name.
|
||||||
cd "${KUBE_CODEGEN_ROOT}"
|
cd "${KUBE_CODEGEN_ROOT}"
|
||||||
BINS=(
|
BINS=(
|
||||||
register-gen
|
register-gen"${CODEGEN_VERSION_SPEC}"
|
||||||
)
|
)
|
||||||
# shellcheck disable=2046 # printf word-splitting is intentional
|
# shellcheck disable=2046 # printf word-splitting is intentional
|
||||||
GO111MODULE=on go install $(printf "k8s.io/code-generator/cmd/%s " "${BINS[@]}")
|
GO111MODULE=on go install $(printf "k8s.io/code-generator/cmd/%s " "${BINS[@]}")
|
||||||
|
Loading…
Reference in New Issue
Block a user