mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 19:31:44 +00:00
Merge pull request #115222 from thockin/call-go-install-instead-of-build-make
Call `go install` instead of build.sh
This commit is contained in:
commit
ae876d4f1d
@ -33,7 +33,6 @@ GENERATED_FILE_PREFIX="${GENERATED_FILE_PREFIX:-zz_generated.}"
|
|||||||
UPDATE_API_KNOWN_VIOLATIONS="${UPDATE_API_KNOWN_VIOLATIONS:-}"
|
UPDATE_API_KNOWN_VIOLATIONS="${UPDATE_API_KNOWN_VIOLATIONS:-}"
|
||||||
|
|
||||||
OUT_DIR="_output"
|
OUT_DIR="_output"
|
||||||
BIN_DIR="${OUT_DIR}/bin"
|
|
||||||
PRJ_SRC_PATH="k8s.io/kubernetes"
|
PRJ_SRC_PATH="k8s.io/kubernetes"
|
||||||
BOILERPLATE_FILENAME="vendor/k8s.io/code-generator/hack/boilerplate.go.txt"
|
BOILERPLATE_FILENAME="vendor/k8s.io/code-generator/hack/boilerplate.go.txt"
|
||||||
APPLYCONFIG_PKG="k8s.io/client-go/applyconfigurations"
|
APPLYCONFIG_PKG="k8s.io/client-go/applyconfigurations"
|
||||||
@ -116,13 +115,15 @@ fi
|
|||||||
# // +k8s:prerelease-lifecycle-gen=true
|
# // +k8s:prerelease-lifecycle-gen=true
|
||||||
function codegen::prerelease() {
|
function codegen::prerelease() {
|
||||||
# Build the tool.
|
# Build the tool.
|
||||||
hack/make-rules/build.sh k8s.io/code-generator/cmd/prerelease-lifecycle-gen
|
GO111MODULE=on GOPROXY=off go install \
|
||||||
|
k8s.io/code-generator/cmd/prerelease-lifecycle-gen
|
||||||
|
|
||||||
# The result file, in each pkg, of prerelease-lifecycle generation.
|
# The result file, in each pkg, of prerelease-lifecycle generation.
|
||||||
local output_base="${GENERATED_FILE_PREFIX}prerelease-lifecycle"
|
local output_base="${GENERATED_FILE_PREFIX}prerelease-lifecycle"
|
||||||
|
|
||||||
# The tool used to generate prerelease-lifecycle code.
|
# The tool used to generate prerelease-lifecycle code.
|
||||||
local gen_prerelease_bin="${BIN_DIR}/prerelease-lifecycle-gen"
|
local gen_prerelease_bin
|
||||||
|
gen_prerelease_bin="$(kube::util::find-binary "prerelease-lifecycle-gen")"
|
||||||
|
|
||||||
# Find all the directories that request prerelease-lifecycle generation.
|
# Find all the directories that request prerelease-lifecycle generation.
|
||||||
if [[ "${DBG_CODEGEN}" == 1 ]]; then
|
if [[ "${DBG_CODEGEN}" == 1 ]]; then
|
||||||
@ -175,13 +176,15 @@ function codegen::prerelease() {
|
|||||||
# scheme
|
# scheme
|
||||||
function codegen::deepcopy() {
|
function codegen::deepcopy() {
|
||||||
# Build the tool.
|
# Build the tool.
|
||||||
hack/make-rules/build.sh k8s.io/code-generator/cmd/deepcopy-gen
|
GO111MODULE=on GOPROXY=off go install \
|
||||||
|
k8s.io/code-generator/cmd/deepcopy-gen
|
||||||
|
|
||||||
# The result file, in each pkg, of deep-copy generation.
|
# The result file, in each pkg, of deep-copy generation.
|
||||||
local output_base="${GENERATED_FILE_PREFIX}deepcopy"
|
local output_base="${GENERATED_FILE_PREFIX}deepcopy"
|
||||||
|
|
||||||
# The tool used to generate deep copies.
|
# The tool used to generate deep copies.
|
||||||
local gen_deepcopy_bin="${BIN_DIR}/deepcopy-gen"
|
local gen_deepcopy_bin
|
||||||
|
gen_deepcopy_bin="$(kube::util::find-binary "deepcopy-gen")"
|
||||||
|
|
||||||
# Find all the directories that request deep-copy generation.
|
# Find all the directories that request deep-copy generation.
|
||||||
if [[ "${DBG_CODEGEN}" == 1 ]]; then
|
if [[ "${DBG_CODEGEN}" == 1 ]]; then
|
||||||
@ -241,13 +244,15 @@ function codegen::deepcopy() {
|
|||||||
# for having a defaulter generated
|
# for having a defaulter generated
|
||||||
function codegen::defaults() {
|
function codegen::defaults() {
|
||||||
# Build the tool.
|
# Build the tool.
|
||||||
hack/make-rules/build.sh k8s.io/code-generator/cmd/defaulter-gen
|
GO111MODULE=on GOPROXY=off go install \
|
||||||
|
k8s.io/code-generator/cmd/defaulter-gen
|
||||||
|
|
||||||
# The result file, in each pkg, of defaulter generation.
|
# The result file, in each pkg, of defaulter generation.
|
||||||
local output_base="${GENERATED_FILE_PREFIX}defaults"
|
local output_base="${GENERATED_FILE_PREFIX}defaults"
|
||||||
|
|
||||||
# The tool used to generate defaulters.
|
# The tool used to generate defaulters.
|
||||||
local gen_defaulter_bin="${BIN_DIR}/defaulter-gen"
|
local gen_defaulter_bin
|
||||||
|
gen_defaulter_bin="$(kube::util::find-binary "defaulter-gen")"
|
||||||
|
|
||||||
# All directories that request any form of defaulter generation.
|
# All directories that request any form of defaulter generation.
|
||||||
if [[ "${DBG_CODEGEN}" == 1 ]]; then
|
if [[ "${DBG_CODEGEN}" == 1 ]]; then
|
||||||
@ -312,13 +317,15 @@ function codegen::defaults() {
|
|||||||
# IDL.
|
# IDL.
|
||||||
function codegen::conversions() {
|
function codegen::conversions() {
|
||||||
# Build the tool.
|
# Build the tool.
|
||||||
hack/make-rules/build.sh k8s.io/code-generator/cmd/conversion-gen
|
GO111MODULE=on GOPROXY=off go install \
|
||||||
|
k8s.io/code-generator/cmd/conversion-gen
|
||||||
|
|
||||||
# The result file, in each pkg, of conversion generation.
|
# The result file, in each pkg, of conversion generation.
|
||||||
local output_base="${GENERATED_FILE_PREFIX}conversion"
|
local output_base="${GENERATED_FILE_PREFIX}conversion"
|
||||||
|
|
||||||
# The tool used to generate conversions.
|
# The tool used to generate conversions.
|
||||||
local gen_conversion_bin="${BIN_DIR}/conversion-gen"
|
local gen_conversion_bin
|
||||||
|
gen_conversion_bin="$(kube::util::find-binary "conversion-gen")"
|
||||||
|
|
||||||
# All directories that request any form of conversion generation.
|
# All directories that request any form of conversion generation.
|
||||||
if [[ "${DBG_CODEGEN}" == 1 ]]; then
|
if [[ "${DBG_CODEGEN}" == 1 ]]; then
|
||||||
@ -433,13 +440,15 @@ function indirect_array() {
|
|||||||
# // +k8s:openapi-gen=true
|
# // +k8s:openapi-gen=true
|
||||||
function codegen::openapi() {
|
function codegen::openapi() {
|
||||||
# Build the tool.
|
# Build the tool.
|
||||||
hack/make-rules/build.sh k8s.io/kube-openapi/cmd/openapi-gen
|
GO111MODULE=on GOPROXY=off go install \
|
||||||
|
k8s.io/kube-openapi/cmd/openapi-gen
|
||||||
|
|
||||||
# The result file, in each pkg, of open-api generation.
|
# The result file, in each pkg, of open-api generation.
|
||||||
local output_base="${GENERATED_FILE_PREFIX}openapi"
|
local output_base="${GENERATED_FILE_PREFIX}openapi"
|
||||||
|
|
||||||
# The tool used to generate open apis.
|
# The tool used to generate open apis.
|
||||||
local gen_openapi_bin="${BIN_DIR}/openapi-gen"
|
local gen_openapi_bin
|
||||||
|
gen_openapi_bin="$(kube::util::find-binary "openapi-gen")"
|
||||||
|
|
||||||
# Standard dirs which all targets need.
|
# Standard dirs which all targets need.
|
||||||
local apimachinery_dirs=(
|
local apimachinery_dirs=(
|
||||||
@ -557,7 +566,7 @@ function codegen::openapi() {
|
|||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./hack/run-in-gopath.sh ${gen_openapi_bin} \
|
./hack/run-in-gopath.sh "${gen_openapi_bin}" \
|
||||||
--v "${KUBE_VERBOSE}" \
|
--v "${KUBE_VERBOSE}" \
|
||||||
--logtostderr \
|
--logtostderr \
|
||||||
-h "${BOILERPLATE_FILENAME}" \
|
-h "${BOILERPLATE_FILENAME}" \
|
||||||
@ -673,7 +682,8 @@ function codegen::clients() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function codegen::listers() {
|
function codegen::listers() {
|
||||||
GO111MODULE=on GOPROXY=off go install k8s.io/code-generator/cmd/lister-gen
|
GO111MODULE=on GOPROXY=off go install \
|
||||||
|
k8s.io/code-generator/cmd/lister-gen
|
||||||
|
|
||||||
local listergen
|
local listergen
|
||||||
listergen=$(kube::util::find-binary "lister-gen")
|
listergen=$(kube::util::find-binary "lister-gen")
|
||||||
|
@ -26,6 +26,8 @@ set -o pipefail
|
|||||||
KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
|
KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
|
||||||
source "${KUBE_ROOT}/hack/lib/init.sh"
|
source "${KUBE_ROOT}/hack/lib/init.sh"
|
||||||
|
|
||||||
|
kube::golang::setup_env
|
||||||
|
|
||||||
# Generates types_swagger_doc_generated file for the given group version.
|
# Generates types_swagger_doc_generated file for the given group version.
|
||||||
# $1: Name of the group version
|
# $1: Name of the group version
|
||||||
# $2: Path to the directory where types.go for that group version exists. This
|
# $2: Path to the directory where types.go for that group version exists. This
|
||||||
@ -57,7 +59,11 @@ gen_types_swagger_doc() {
|
|||||||
EOF
|
EOF
|
||||||
} > "${TMPFILE}"
|
} > "${TMPFILE}"
|
||||||
|
|
||||||
_output/bin/genswaggertypedocs -s \
|
local genswaggertypedocs
|
||||||
|
genswaggertypedocs=$(kube::util::find-binary "genswaggertypedocs")
|
||||||
|
|
||||||
|
"${genswaggertypedocs}" \
|
||||||
|
-s \
|
||||||
"${gv_dir}/types.go" \
|
"${gv_dir}/types.go" \
|
||||||
-f - \
|
-f - \
|
||||||
>> "${TMPFILE}"
|
>> "${TMPFILE}"
|
||||||
@ -76,7 +82,7 @@ for group_version in "${GROUP_VERSIONS[@]}"; do
|
|||||||
done
|
done
|
||||||
|
|
||||||
# Ensure we have the latest genswaggertypedocs built
|
# Ensure we have the latest genswaggertypedocs built
|
||||||
hack/make-rules/build.sh ./cmd/genswaggertypedocs
|
GO111MODULE=on GOPROXY=off go install ./cmd/genswaggertypedocs
|
||||||
|
|
||||||
# Regenerate files.
|
# Regenerate files.
|
||||||
for group_version in "${GROUP_VERSIONS[@]}"; do
|
for group_version in "${GROUP_VERSIONS[@]}"; do
|
||||||
|
Loading…
Reference in New Issue
Block a user