/cluster: cleanup clientbin.sh

clientbin.sh is only used in kubectl.sh. It contains logic
for finding a binary that was build from the k/k tree
and for printing errors if the binary cannot be found.

- Remove clientbin.sh
- Remove references of clientbin.sh from /cluster/BUILD
- Use hack/lib/util.sh's kube::util::find-binary for finding the binary
This commit is contained in:
Lubomir I. Ivanov
2020-04-24 00:22:21 +03:00
parent 0acf2f0983
commit b4bbf0a69f
3 changed files with 13 additions and 121 deletions

View File

@@ -32,15 +32,25 @@ set -o pipefail
KUBE_ROOT=${KUBE_ROOT:-$(dirname "${BASH_SOURCE[0]}")/..}
source "${KUBE_ROOT}/cluster/kube-util.sh"
source "${KUBE_ROOT}/cluster/clientbin.sh"
source "${KUBE_ROOT}/hack/lib/util.sh"
# If KUBECTL_PATH isn't set, gather up the list of likely places and use ls
# to find the latest one.
if [[ -z "${KUBECTL_PATH:-}" ]]; then
kubectl=$( get_bin "kubectl" "cmd/kubectl" )
kubectl=$( kube::util::find-binary "kubectl" )
if [[ ! -x "$kubectl" ]]; then
print_error "kubectl"
{
echo "It looks as if you don't have a compiled kubectl binary"
echo
echo "If you are running from a clone of the git repo, please run"
echo "'./build/run.sh make cross'. Note that this requires having"
echo "Docker installed."
echo
echo "If you are running from a binary release tarball, something is wrong. "
echo "Look at http://kubernetes.io/ for information on how to contact the "
echo "development team for help."
} >&2
exit 1
fi
elif [[ ! -x "${KUBECTL_PATH}" ]]; then