mirror of
https://github.com/kubernetes/kubernetes.git
synced 2026-06-09 00:34:10 -04: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
1 changed files with 7 additions and 6 deletions
|
|
@ -223,6 +223,12 @@ kube::util::find-binary-for-platform() {
|
|||
|
||||
# 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 +248,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 +765,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
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue