Skip to content

Commit 855c291

Browse files
authored
Merge pull request kubernetes#76858 from SataQiu/fix-cluster-clientbin-20190420
Fix shellcheck failures of cluster/clientbin.sh
2 parents 9b437f9 + aacab2e commit 855c291

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

cluster/clientbin.sh

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,6 @@ case "$(uname -m)" in
6565
;;
6666
esac
6767

68-
# Get the absolute path of the directory component of a file, i.e. the
69-
# absolute path of the dirname of $1.
70-
get_absolute_dirname() {
71-
echo "$(cd "$(dirname "$1")" && pwd)"
72-
}
73-
7468
function get_bin() {
7569
bin="${1:-}"
7670
srcdir="${2:-}"
@@ -93,9 +87,12 @@ function get_bin() {
9387
# The bazel go rules place binaries in subtrees like
9488
# "bazel-bin/source/path/linux_amd64_pure_stripped/binaryname", so make sure
9589
# the platform name is matched in the path.
96-
locations+=($(find "${KUBE_ROOT}/bazel-bin/${srcdir}" -type f -executable \
97-
-path "*/${host_os}_${host_arch}*/${bin}" 2>/dev/null || true) )
98-
echo $( (ls -t "${locations[@]}" 2>/dev/null || true) | head -1 )
90+
while IFS=$'\n' read -r line; do
91+
locations+=( "${line}" )
92+
done < <(find "${KUBE_ROOT}/bazel-bin/${srcdir}" -type f -executable \
93+
-path "*/${host_os}_${host_arch}*/${bin}" 2>/dev/null || true)
94+
95+
(ls -t "${locations[@]}" 2>/dev/null || true) | head -1
9996
}
10097

10198
function print_error() {

hack/.shellcheck_failures

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
./build/lib/release.sh
22
./cluster/addons/addon-manager/kube-addons.sh
33
./cluster/addons/fluentd-elasticsearch/es-image/run.sh
4-
./cluster/clientbin.sh
54
./cluster/common.sh
65
./cluster/gce/config-common.sh
76
./cluster/gce/config-default.sh

0 commit comments

Comments
 (0)