Merge pull request #94449 from justaugustus/go115

[go1.15] Update to go1.15.2
This commit is contained in:
Kubernetes Prow Robot
2020-09-15 15:15:19 -07:00
committed by GitHub
16 changed files with 157 additions and 145 deletions

View File

@@ -207,22 +207,25 @@ kube::util::find-binary-for-platform() {
"${KUBE_ROOT}/_output/dockerized/go/bin/${lookfor}"
);
fi
# Also search for binary in bazel build tree.
# The bazel go rules place some binaries in subtrees like
# "bazel-bin/source/path/linux_amd64_pure_stripped/binaryname", so make sure
# the platform name is matched in the path.
while IFS=$'\n' read -r location; do
locations+=("$location");
done < <(find "${KUBE_ROOT}/bazel-bin/" -type f -executable \
\( -path "*/${platform/\//_}*/${lookfor}" -o -path "*/${lookfor}" \) 2>/dev/null || true)
# search for executables for non-GNU versions of find (eg. BSD)
while IFS=$'\n' read -r location; do
locations+=("$location");
done < <(find "${KUBE_ROOT}/bazel-bin/" -type f -perm -111 \
\( -path "*/${platform/\//_}*/${lookfor}" -o -path "*/${lookfor}" \) 2>/dev/null || true)
# Also search for binary in bazel build tree if bazel-out/ exists.
if [[ -d "${KUBE_ROOT}/bazel-out" ]]; then
while IFS=$'\n' read -r bin_build_mode; do
if grep -q "${platform}" "${bin_build_mode}"; then
# drop the extension to get the real binary path.
locations+=("${bin_build_mode%.*}")
fi
done < <(find "${KUBE_ROOT}/bazel-out/" -name "${lookfor}.go_build_mode")
fi
# List most recently-updated location.
local -r bin=$( (ls -t "${locations[@]}" 2>/dev/null || true) | head -1 )
if [[ -z "${bin}" ]]; then
kube::log::error "Failed to find binary ${lookfor} for platform ${platform}"
return 1
fi
echo -n "${bin}"
}
@@ -242,11 +245,6 @@ kube::util::gen-docs() {
genkubedocs=$(kube::util::find-binary "genkubedocs")
genman=$(kube::util::find-binary "genman")
genyaml=$(kube::util::find-binary "genyaml")
genfeddocs=$(kube::util::find-binary "genfeddocs")
# TODO: If ${genfeddocs} is not used from anywhere (it isn't used at
# least from k/k tree), remove it completely.
kube::util::sourced_variable "${genfeddocs}"
mkdir -p "${dest}/docs/user-guide/kubectl/"
"${gendocs}" "${dest}/docs/user-guide/kubectl/"
@@ -764,7 +762,7 @@ function kube::util::check-file-in-alphabetical-order {
# Checks whether jq is installed.
function kube::util::require-jq {
if ! command -v jq &>/dev/null; then
echo "jq not found. Please install." 1>&2
kube::log::error "jq not found. Please install."
return 1
fi
}