mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
Build in hermetic module mode
This commit is contained in:
parent
2a10ca650d
commit
6cdaecfe0a
@ -382,11 +382,14 @@ kube::golang::is_statically_linked_library() {
|
|||||||
kube::golang::binaries_from_targets() {
|
kube::golang::binaries_from_targets() {
|
||||||
local target
|
local target
|
||||||
for target; do
|
for target; do
|
||||||
|
if [[ "${target}" =~ ^([[:alnum:]]+".")+[[:alnum:]]+"/" ]]; then
|
||||||
# If the target starts with what looks like a domain name, assume it has a
|
# 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
|
# fully-qualified package name rather than one that needs the Kubernetes
|
||||||
# package prepended.
|
# package prepended.
|
||||||
if [[ "${target}" =~ ^([[:alnum:]]+".")+[[:alnum:]]+"/" ]]; then
|
|
||||||
echo "${target}"
|
echo "${target}"
|
||||||
|
elif [[ "${target}" =~ ^vendor/ ]]; then
|
||||||
|
# Strip vendor/ prefix, since we're building in gomodule mode.
|
||||||
|
echo "${target#"vendor/"}"
|
||||||
else
|
else
|
||||||
echo "${KUBE_GO_PACKAGE}/${target}"
|
echo "${KUBE_GO_PACKAGE}/${target}"
|
||||||
fi
|
fi
|
||||||
@ -668,13 +671,13 @@ kube::golang::build_some_binaries() {
|
|||||||
done
|
done
|
||||||
if [[ "${#uncovered[@]}" != 0 ]]; then
|
if [[ "${#uncovered[@]}" != 0 ]]; then
|
||||||
V=2 kube::log::info "Building ${uncovered[*]} without coverage..."
|
V=2 kube::log::info "Building ${uncovered[*]} without coverage..."
|
||||||
go install "${build_args[@]}" "${uncovered[@]}"
|
GO111MODULE=on GOPROXY=off go install "${build_args[@]}" "${uncovered[@]}"
|
||||||
else
|
else
|
||||||
V=2 kube::log::info "Nothing to build without coverage."
|
V=2 kube::log::info "Nothing to build without coverage."
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
V=2 kube::log::info "Coverage is disabled."
|
V=2 kube::log::info "Coverage is disabled."
|
||||||
go install "${build_args[@]}" "$@"
|
GO111MODULE=on GOPROXY=off go install "${build_args[@]}" "$@"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user