mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-09 03:57:41 +00:00
hack/lib/util.sh: some bash cleanups
* switched one spot to use kube::logging * make kube::util::find-binary return an error when it doesn't find anything so that hack scripts fail fast instead of with '' binary not found errors. * this required deleting some genfeddoc stuff. the binary no longer exists in k/k repo since we removed federation/, and I don't see it in https://github.com/kubernetes-sigs/kubefed/ either. I'm assuming that it's gone for good now.
This commit is contained in:
parent
bb1855bf11
commit
5a72bb001f
@ -223,6 +223,12 @@ kube::util::find-binary-for-platform() {
|
|||||||
|
|
||||||
# List most recently-updated location.
|
# List most recently-updated location.
|
||||||
local -r bin=$( (ls -t "${locations[@]}" 2>/dev/null || true) | head -1 )
|
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}"
|
echo -n "${bin}"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -242,11 +248,6 @@ kube::util::gen-docs() {
|
|||||||
genkubedocs=$(kube::util::find-binary "genkubedocs")
|
genkubedocs=$(kube::util::find-binary "genkubedocs")
|
||||||
genman=$(kube::util::find-binary "genman")
|
genman=$(kube::util::find-binary "genman")
|
||||||
genyaml=$(kube::util::find-binary "genyaml")
|
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/"
|
mkdir -p "${dest}/docs/user-guide/kubectl/"
|
||||||
"${gendocs}" "${dest}/docs/user-guide/kubectl/"
|
"${gendocs}" "${dest}/docs/user-guide/kubectl/"
|
||||||
@ -764,7 +765,7 @@ function kube::util::check-file-in-alphabetical-order {
|
|||||||
# Checks whether jq is installed.
|
# Checks whether jq is installed.
|
||||||
function kube::util::require-jq {
|
function kube::util::require-jq {
|
||||||
if ! command -v jq &>/dev/null; then
|
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
|
return 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user