mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 04:06:03 +00:00
Merge pull request #109464 from liggitt/gomodule-install
Use module mode when building/installing
This commit is contained in:
commit
5e9a6a256e
@ -106,7 +106,7 @@ ginkgo:
|
||||
echo "$$GINKGO_HELP_INFO"
|
||||
else
|
||||
ginkgo:
|
||||
hack/make-rules/build.sh vendor/github.com/onsi/ginkgo/ginkgo
|
||||
hack/make-rules/build.sh github.com/onsi/ginkgo/ginkgo
|
||||
endif
|
||||
|
||||
define VERIFY_HELP_INFO
|
||||
|
@ -219,7 +219,7 @@ $(PRERELEASE_LIFECYCLE_FILES): $(PRERELEASE_LIFECYCLE_GEN)
|
||||
# it, and make is happy.
|
||||
$(PRERELEASE_LIFECYCLE_GEN): $(GODEPS_k8s.io/kubernetes/vendor/k8s.io/code-generator/cmd/prerelease-lifecycle-gen)
|
||||
KUBE_BUILD_PLATFORMS="" \
|
||||
hack/make-rules/build.sh vendor/k8s.io/code-generator/cmd/prerelease-lifecycle-gen
|
||||
hack/make-rules/build.sh k8s.io/code-generator/cmd/prerelease-lifecycle-gen
|
||||
touch $@
|
||||
|
||||
|
||||
@ -314,7 +314,7 @@ $(DEEPCOPY_FILES): $(DEEPCOPY_GEN)
|
||||
# it, and make is happy.
|
||||
$(DEEPCOPY_GEN): $(GODEPS_k8s.io/kubernetes/vendor/k8s.io/code-generator/cmd/deepcopy-gen)
|
||||
KUBE_BUILD_PLATFORMS="" \
|
||||
hack/make-rules/build.sh vendor/k8s.io/code-generator/cmd/deepcopy-gen
|
||||
hack/make-rules/build.sh k8s.io/code-generator/cmd/deepcopy-gen
|
||||
touch $@
|
||||
|
||||
|
||||
@ -415,7 +415,7 @@ $(DEFAULTER_FILES): $(DEFAULTER_GEN)
|
||||
# it, and make is happy.
|
||||
$(DEFAULTER_GEN): $(GODEPS_k8s.io/kubernetes/vendor/k8s.io/code-generator/cmd/defaulter-gen)
|
||||
KUBE_BUILD_PLATFORMS="" \
|
||||
hack/make-rules/build.sh vendor/k8s.io/code-generator/cmd/defaulter-gen
|
||||
hack/make-rules/build.sh k8s.io/code-generator/cmd/defaulter-gen
|
||||
touch $@
|
||||
|
||||
|
||||
@ -529,7 +529,7 @@ $(CONVERSION_FILES): $(CONVERSION_GEN)
|
||||
# and make is happy.
|
||||
$(CONVERSION_GEN): $(GODEPS_k8s.io/kubernetes/vendor/k8s.io/code-generator/cmd/conversion-gen)
|
||||
KUBE_BUILD_PLATFORMS="" \
|
||||
hack/make-rules/build.sh vendor/k8s.io/code-generator/cmd/conversion-gen
|
||||
hack/make-rules/build.sh k8s.io/code-generator/cmd/conversion-gen
|
||||
touch $@
|
||||
|
||||
|
||||
@ -656,5 +656,5 @@ gen_openapi: $(OPENAPI_GEN) $(KUBE_OPENAPI_OUTFILE) $(AGGREGATOR_OPENAPI_OUTFILE
|
||||
# it, and make is happy.
|
||||
$(OPENAPI_GEN): $(GODEPS_k8s.io/kubernetes/vendor/k8s.io/kube-openapi/cmd/openapi-gen)
|
||||
KUBE_BUILD_PLATFORMS="" \
|
||||
hack/make-rules/build.sh vendor/k8s.io/kube-openapi/cmd/openapi-gen
|
||||
hack/make-rules/build.sh k8s.io/kube-openapi/cmd/openapi-gen
|
||||
touch $@
|
||||
|
@ -42,7 +42,7 @@ IMAGE="${REGISTRY}/conformance-amd64:${VERSION}"
|
||||
|
||||
kube::build::verify_prereqs
|
||||
kube::build::build_image
|
||||
kube::build::run_build_command make WHAT="vendor/github.com/onsi/ginkgo/ginkgo test/e2e/e2e.test cmd/kubectl test/conformance/image/go-runner"
|
||||
kube::build::run_build_command make WHAT="github.com/onsi/ginkgo/ginkgo test/e2e/e2e.test cmd/kubectl test/conformance/image/go-runner"
|
||||
kube::build::copy_output
|
||||
|
||||
make -C "${KUBE_ROOT}/test/conformance/image" build
|
||||
|
@ -111,7 +111,7 @@ readonly KUBE_SERVER_IMAGE_BINARIES=("${KUBE_SERVER_IMAGE_TARGETS[@]##*/}")
|
||||
kube::golang::conformance_image_targets() {
|
||||
# NOTE: this contains cmd targets for kube::release::build_conformance_image
|
||||
local targets=(
|
||||
vendor/github.com/onsi/ginkgo/ginkgo
|
||||
github.com/onsi/ginkgo/ginkgo
|
||||
test/e2e/e2e.test
|
||||
test/conformance/image/go-runner
|
||||
cmd/kubectl
|
||||
@ -274,7 +274,7 @@ kube::golang::test_targets() {
|
||||
cmd/genyaml
|
||||
cmd/genswaggertypedocs
|
||||
cmd/linkcheck
|
||||
vendor/github.com/onsi/ginkgo/ginkgo
|
||||
github.com/onsi/ginkgo/ginkgo
|
||||
test/e2e/e2e.test
|
||||
test/conformance/image/go-runner
|
||||
)
|
||||
@ -301,7 +301,7 @@ readonly KUBE_TEST_PORTABLE=(
|
||||
kube::golang::server_test_targets() {
|
||||
local targets=(
|
||||
cmd/kubemark
|
||||
vendor/github.com/onsi/ginkgo/ginkgo
|
||||
github.com/onsi/ginkgo/ginkgo
|
||||
)
|
||||
|
||||
if [[ "${OSTYPE:-}" == "linux"* ]]; then
|
||||
@ -382,11 +382,14 @@ kube::golang::is_statically_linked_library() {
|
||||
kube::golang::binaries_from_targets() {
|
||||
local target
|
||||
for target; do
|
||||
# If the target starts with what looks like a domain name, assume it has a
|
||||
# fully-qualified package name rather than one that needs the Kubernetes
|
||||
# package prepended.
|
||||
if [[ "${target}" =~ ^([[:alnum:]]+".")+[[:alnum:]]+"/" ]]; then
|
||||
# If the target starts with what looks like a domain name, assume it has a
|
||||
# fully-qualified package name rather than one that needs the Kubernetes
|
||||
# package prepended.
|
||||
echo "${target}"
|
||||
elif [[ "${target}" =~ ^vendor/ ]]; then
|
||||
# Strip vendor/ prefix, since we're building in gomodule mode.
|
||||
echo "${target#"vendor/"}"
|
||||
else
|
||||
echo "${KUBE_GO_PACKAGE}/${target}"
|
||||
fi
|
||||
@ -668,13 +671,13 @@ kube::golang::build_some_binaries() {
|
||||
done
|
||||
if [[ "${#uncovered[@]}" != 0 ]]; then
|
||||
V=2 kube::log::info "Building ${uncovered[*]} without coverage..."
|
||||
go install "${build_args[@]}" "${uncovered[@]}"
|
||||
GO111MODULE=on GOPROXY=off go install "${build_args[@]}" "${uncovered[@]}"
|
||||
else
|
||||
V=2 kube::log::info "Nothing to build without coverage."
|
||||
fi
|
||||
else
|
||||
V=2 kube::log::info "Coverage is disabled."
|
||||
go install "${build_args[@]}" "$@"
|
||||
GO111MODULE=on GOPROXY=off go install "${build_args[@]}" "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@ source "${KUBE_ROOT}/hack/lib/init.sh"
|
||||
# $1: Full path to the directory where the api.proto file is
|
||||
function kube::protoc::generate_proto() {
|
||||
kube::golang::setup_env
|
||||
go install k8s.io/kubernetes/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protoc-gen-gogo
|
||||
GO111MODULE=on GOPROXY=off go install k8s.io/code-generator/cmd/go-to-protobuf/protoc-gen-gogo
|
||||
|
||||
kube::protoc::check_protoc
|
||||
|
||||
|
@ -53,7 +53,7 @@ EOF
|
||||
|
||||
if ! which genswaggertypedocs >/dev/null; then
|
||||
# build if needed
|
||||
go install k8s.io/kubernetes/cmd/genswaggertypedocs
|
||||
GO111MODULE=on GOPROXY=off go install k8s.io/kubernetes/cmd/genswaggertypedocs
|
||||
fi
|
||||
|
||||
genswaggertypedocs -s \
|
||||
|
@ -26,11 +26,11 @@ source "${KUBE_ROOT}/hack/lib/init.sh"
|
||||
|
||||
kube::golang::setup_env
|
||||
|
||||
go install k8s.io/kubernetes/pkg/generated/openapi/cmd/models-schema
|
||||
go install k8s.io/kubernetes/vendor/k8s.io/code-generator/cmd/client-gen
|
||||
go install k8s.io/kubernetes/vendor/k8s.io/code-generator/cmd/lister-gen
|
||||
go install k8s.io/kubernetes/vendor/k8s.io/code-generator/cmd/informer-gen
|
||||
go install k8s.io/kubernetes/vendor/k8s.io/code-generator/cmd/applyconfiguration-gen
|
||||
GO111MODULE=on GOPROXY=off go install k8s.io/kubernetes/pkg/generated/openapi/cmd/models-schema
|
||||
GO111MODULE=on GOPROXY=off go install k8s.io/code-generator/cmd/client-gen
|
||||
GO111MODULE=on GOPROXY=off go install k8s.io/code-generator/cmd/lister-gen
|
||||
GO111MODULE=on GOPROXY=off go install k8s.io/code-generator/cmd/informer-gen
|
||||
GO111MODULE=on GOPROXY=off go install k8s.io/code-generator/cmd/applyconfiguration-gen
|
||||
|
||||
modelsschema=$(kube::util::find-binary "models-schema")
|
||||
clientgen=$(kube::util::find-binary "client-gen")
|
||||
|
@ -24,7 +24,7 @@ source "${KUBE_ROOT}/hack/lib/init.sh"
|
||||
|
||||
kube::golang::setup_env
|
||||
|
||||
go install k8s.io/kubernetes/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protoc-gen-gogo
|
||||
GO111MODULE=on GOPROXY=off go install k8s.io/code-generator/cmd/go-to-protobuf/protoc-gen-gogo
|
||||
|
||||
if [[ -z "$(which protoc)" || "$(protoc --version)" != "libprotoc 3."* ]]; then
|
||||
echo "Generating protobuf requires protoc 3.0.0-beta1 or newer. Please download and"
|
||||
|
@ -28,8 +28,8 @@ source "${KUBE_ROOT}/hack/lib/init.sh"
|
||||
|
||||
kube::golang::setup_env
|
||||
|
||||
go install k8s.io/kubernetes/vendor/k8s.io/code-generator/cmd/go-to-protobuf
|
||||
go install k8s.io/kubernetes/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protoc-gen-gogo
|
||||
GO111MODULE=on GOPROXY=off go install k8s.io/code-generator/cmd/go-to-protobuf
|
||||
GO111MODULE=on GOPROXY=off go install k8s.io/code-generator/cmd/go-to-protobuf/protoc-gen-gogo
|
||||
|
||||
if [[ -z "$(which protoc)" || "$(protoc --version)" != "libprotoc 3."* ]]; then
|
||||
echo "Generating protobuf requires protoc 3.0.0-beta1 or newer. Please download and"
|
||||
|
@ -29,7 +29,7 @@ runtime_versions=("v1alpha2" "v1")
|
||||
|
||||
kube::golang::setup_env
|
||||
|
||||
go install k8s.io/kubernetes/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protoc-gen-gogo
|
||||
GO111MODULE=on GOPROXY=off go install k8s.io/code-generator/cmd/go-to-protobuf/protoc-gen-gogo
|
||||
|
||||
if [[ -z "$(which protoc)" || "$(protoc --version)" != "libprotoc 3."* ]]; then
|
||||
echo "Generating protobuf requires protoc 3.0.0-beta1 or newer. Please download and"
|
||||
|
@ -36,7 +36,7 @@ for group_version in "${GROUP_VERSIONS[@]}"; do
|
||||
rm -f "$(kube::util::group-version-to-pkg-path "${group_version}")/types_swagger_doc_generated.go"
|
||||
done
|
||||
# ensure we have the latest genswaggertypedocs built
|
||||
go install k8s.io/kubernetes/cmd/genswaggertypedocs
|
||||
GO111MODULE=on GOPROXY=off go install k8s.io/kubernetes/cmd/genswaggertypedocs
|
||||
for group_version in "${GROUP_VERSIONS[@]}"; do
|
||||
kube::swagger::gen_types_swagger_doc "${group_version}" "$(kube::util::group-version-to-pkg-path "${group_version}")"
|
||||
done
|
||||
|
@ -28,7 +28,7 @@ source "${KUBE_ROOT}/hack/lib/init.sh"
|
||||
|
||||
kube::golang::setup_env
|
||||
|
||||
go install k8s.io/kubernetes/vendor/k8s.io/code-generator/cmd/import-boss
|
||||
GO111MODULE=on GOPROXY=off go install k8s.io/code-generator/cmd/import-boss
|
||||
|
||||
packages=(
|
||||
"k8s.io/kubernetes/pkg/..."
|
||||
|
@ -26,7 +26,7 @@ cd "${KUBE_ROOT}"
|
||||
# NOTE: we do *not* use `make WHAT=...` because we do *not* want to be running
|
||||
# make generated_files when diffing things (see: hack/verify-conformance-yaml.sh)
|
||||
# other update/verify already handle the generated files
|
||||
hack/make-rules/build.sh vendor/github.com/onsi/ginkgo/ginkgo test/e2e/e2e.test
|
||||
hack/make-rules/build.sh github.com/onsi/ginkgo/ginkgo test/e2e/e2e.test
|
||||
|
||||
# dump spec
|
||||
./_output/bin/ginkgo --dryRun=true --focus='[Conformance]' ./_output/bin/e2e.test -- --spec-dump "${KUBE_ROOT}/_output/specsummaries.json" > /dev/null
|
||||
|
@ -33,7 +33,7 @@ var k8sBinDir = flag.String("k8s-bin-dir", "", "Directory containing k8s kubelet
|
||||
var buildTargets = []string{
|
||||
"cmd/kubelet",
|
||||
"test/e2e_node/e2e_node.test",
|
||||
"vendor/github.com/onsi/ginkgo/ginkgo",
|
||||
"github.com/onsi/ginkgo/ginkgo",
|
||||
"cluster/gce/gci/mounter",
|
||||
"test/e2e_node/plugins/gcp-credential-provider",
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user