From e09bc312cbc5986f6e3410dda50f6b7bb7c4ec16 Mon Sep 17 00:00:00 2001 From: Xiang Dai Date: Fri, 29 May 2020 09:56:00 +0800 Subject: [PATCH] *.sh: cleanup all white noise Signed-off-by: Xiang Dai --- cluster/get-kube-binaries.sh | 2 +- cluster/images/conformance/run_e2e.sh | 2 +- cluster/kubemark/gce/config-default.sh | 2 +- cluster/log-dump/log-dump.sh | 2 +- hack/ginkgo-e2e.sh | 2 +- hack/lib/util.sh | 2 +- hack/lint-dependencies.sh | 4 ++-- hack/make-rules/test-cmd.sh | 6 +++--- hack/make-rules/test-e2e-kubeadm.sh | 2 +- hack/make-rules/test-e2e-node.sh | 2 +- hack/update-all.sh | 4 ++-- hack/update-bazel.sh | 2 +- hack/update-import-aliases.sh | 2 +- hack/update-translations.sh | 4 ++-- test/e2e_node/conformance/run_test.sh | 2 +- 15 files changed, 20 insertions(+), 20 deletions(-) diff --git a/cluster/get-kube-binaries.sh b/cluster/get-kube-binaries.sh index 9ea6d0a2f78..47630c615e2 100755 --- a/cluster/get-kube-binaries.sh +++ b/cluster/get-kube-binaries.sh @@ -147,7 +147,7 @@ function download_tarball() { local -r download_path="$1" local -r file="$2" local trace_on="off" - if [[ -o xtrace ]]; then + if [[ -o xtrace ]]; then trace_on="on" set +x fi diff --git a/cluster/images/conformance/run_e2e.sh b/cluster/images/conformance/run_e2e.sh index b60c98d9d2c..55a6796e376 100755 --- a/cluster/images/conformance/run_e2e.sh +++ b/cluster/images/conformance/run_e2e.sh @@ -37,7 +37,7 @@ saveResults() { } # Optional Golang runner alternative to the bash script. -# Entry provided via env var to simplify invocation. +# Entry provided via env var to simplify invocation. if [[ -n ${E2E_USE_GO_RUNNER:-} ]]; then set -x /gorunner && ret=0 || ret=$? diff --git a/cluster/kubemark/gce/config-default.sh b/cluster/kubemark/gce/config-default.sh index c85e1672f72..c8fc31c8080 100644 --- a/cluster/kubemark/gce/config-default.sh +++ b/cluster/kubemark/gce/config-default.sh @@ -31,7 +31,7 @@ TEST_CLUSTER_LOG_LEVEL="${TEST_CLUSTER_LOG_LEVEL:-"--v=4"}" KUBE_GCE_INSTANCE_PREFIX="${KUBE_GCE_INSTANCE_PREFIX:-"default"}" # NUM_NODES is used by start-kubemark.sh to determine a correct number of replicas. -NUM_NODES=${KUBEMARK_NUM_NODES:-10} +NUM_NODES=${KUBEMARK_NUM_NODES:-10} NUM_WINDOWS_NODES=${KUBEMARK_NUM_WINDOWS_NODES:-0} HOLLOW_KUBELET_TEST_LOG_LEVEL="${HOLLOW_KUBELET_TEST_LOG_LEVEL:-$TEST_CLUSTER_LOG_LEVEL}" diff --git a/cluster/log-dump/log-dump.sh b/cluster/log-dump/log-dump.sh index 74051fe9b4a..b066d7107c3 100755 --- a/cluster/log-dump/log-dump.sh +++ b/cluster/log-dump/log-dump.sh @@ -270,7 +270,7 @@ function save-windows-logs-via-ssh() { export-windows-docker-event-log "${node}" export-windows-docker-images-list "${node}" - + local remote_files=() for file in ${windows_node_logfiles[@]}; do remote_files+=( "${WINDOWS_LOGS_DIR}\\${file}" ) diff --git a/hack/ginkgo-e2e.sh b/hack/ginkgo-e2e.sh index b191cda0efd..fed6d95e189 100755 --- a/hack/ginkgo-e2e.sh +++ b/hack/ginkgo-e2e.sh @@ -147,7 +147,7 @@ fi # The --host setting is used only when providing --auth_config # If --kubeconfig is used, the host to use is retrieved from the .kubeconfig # file and the one provided with --host is ignored. -# Add path for things like running kubectl binary. +# Add path for things like running kubectl binary. PATH=$(dirname "${e2e_test}"):"${PATH}" export PATH "${ginkgo}" "${ginkgo_args[@]:+${ginkgo_args[@]}}" "${e2e_test}" -- \ diff --git a/hack/lib/util.sh b/hack/lib/util.sh index 01f8b4bc765..80a7b003912 100755 --- a/hack/lib/util.sh +++ b/hack/lib/util.sh @@ -213,7 +213,7 @@ kube::util::find-binary-for-platform() { locations+=("$location"); done < <(find "${KUBE_ROOT}/bazel-bin/" -type f -perm -111 \ \( -path "*/${platform/\//_}*/${lookfor}" -o -path "*/${lookfor}" \) 2>/dev/null || true) - + # List most recently-updated location. local -r bin=$( (ls -t "${locations[@]}" 2>/dev/null || true) | head -1 ) echo -n "${bin}" diff --git a/hack/lint-dependencies.sh b/hack/lint-dependencies.sh index c85a42491a2..ca8047ebd08 100755 --- a/hack/lint-dependencies.sh +++ b/hack/lint-dependencies.sh @@ -76,8 +76,8 @@ for forbidden_repo in "${forbidden_repos[@]}"; do done outdated=$(go list -m -json all | jq -r " - select(.Replace.Version != null) | - select(.Version != .Replace.Version) | + select(.Replace.Version != null) | + select(.Version != .Replace.Version) | ${filter} select(.Path) | \"\(.Path) diff --git a/hack/make-rules/test-cmd.sh b/hack/make-rules/test-cmd.sh index 0762e633b54..efd5cb5fbc7 100755 --- a/hack/make-rules/test-cmd.sh +++ b/hack/make-rules/test-cmd.sh @@ -76,7 +76,7 @@ function run_kube_apiserver() { } # Runs run_kube_controller_manager -# +# # Exports: # CTLRMGR_PID function run_kube_controller_manager() { @@ -96,7 +96,7 @@ function run_kube_controller_manager() { # Creates a node object with name 127.0.0.1. This is required because we do not # run kubelet. -# +# # Exports: # SUPPORTED_RESOURCES(Array of all resources supported by the apiserver). function create_node() { @@ -121,7 +121,7 @@ __EOF__ # 2) $WHAT is not empty and kubeadm is part of $WHAT WHAT=${WHAT:-} if [[ ${WHAT} == "" || ${WHAT} =~ .*kubeadm.* ]] ; then - kube::log::status "Running kubeadm tests" + kube::log::status "Running kubeadm tests" # build kubeadm make all -C "${KUBE_ROOT}" WHAT=cmd/kubeadm diff --git a/hack/make-rules/test-e2e-kubeadm.sh b/hack/make-rules/test-e2e-kubeadm.sh index 49d9128276c..3f8b54eae5a 100755 --- a/hack/make-rules/test-e2e-kubeadm.sh +++ b/hack/make-rules/test-e2e-kubeadm.sh @@ -55,7 +55,7 @@ if [[ ! -d "${artifacts}" ]]; then fi echo "Test artifacts will be written to ${artifacts}" -# Test +# Test kube::golang::verify_go_version go run test/e2e_kubeadm/runner/local/run_local.go \ diff --git a/hack/make-rules/test-e2e-node.sh b/hack/make-rules/test-e2e-node.sh index 6cfc2d1d6e7..870e40caece 100755 --- a/hack/make-rules/test-e2e-node.sh +++ b/hack/make-rules/test-e2e-node.sh @@ -46,7 +46,7 @@ extra_envs=${EXTRA_ENVS:-} # Parse the flags to pass to ginkgo ginkgoflags="" -if [[ ${parallelism} -gt 1 ]]; then +if [[ ${parallelism} -gt 1 ]]; then ginkgoflags="${ginkgoflags} -nodes=${parallelism} " fi diff --git a/hack/update-all.sh b/hack/update-all.sh index 2d842bd02d0..cea9c8b1fdd 100755 --- a/hack/update-all.sh +++ b/hack/update-all.sh @@ -16,8 +16,8 @@ # This script is a vestigial redirection. Please do not add "real" logic. # The "true" target of this makerule is `hack/make-rules/update.sh`. -# We should run `hack/update-all.sh` if anything fails after -# running `hack/verify-all.sh`. It is equivalent to `make update`. +# We should run `hack/update-all.sh` if anything fails after +# running `hack/verify-all.sh`. It is equivalent to `make update`. # Usage: `hack/update-all.sh` or `make update`. set -o errexit diff --git a/hack/update-bazel.sh b/hack/update-bazel.sh index 688d442457a..5d4040522df 100755 --- a/hack/update-bazel.sh +++ b/hack/update-bazel.sh @@ -62,7 +62,7 @@ done # Run gazelle to update Go rules in BUILD files. # filter out known pkg-config error (see buildozer workaround below) -# NOTE: the `|| exit "${PIPESTATUS[0]}"` is to ignore grep errors +# NOTE: the `|| exit "${PIPESTATUS[0]}"` is to ignore grep errors # while preserving the exit code of gazelle gazelle fix \ -external=vendored \ diff --git a/hack/update-import-aliases.sh b/hack/update-import-aliases.sh index ab096df054f..bfb9e3038c0 100755 --- a/hack/update-import-aliases.sh +++ b/hack/update-import-aliases.sh @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -# This script fixes imports programmatically according to +# This script fixes imports programmatically according to # all the imports that we have our preferred alias(es). # Usage: `hack/update-import-aliases.sh`. diff --git a/hack/update-translations.sh b/hack/update-translations.sh index e59920d0efc..aba316c13bb 100755 --- a/hack/update-translations.sh +++ b/hack/update-translations.sh @@ -14,8 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -# This script updates `translations/kubectl/template.pot` for -# `pkg/kubectl/cmd/*.go pkg/kubectl/cmd/*/*.go`. +# This script updates `translations/kubectl/template.pot` for +# `pkg/kubectl/cmd/*.go pkg/kubectl/cmd/*/*.go`. # Usage: `update-translations.sh`. KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. diff --git a/test/e2e_node/conformance/run_test.sh b/test/e2e_node/conformance/run_test.sh index 5fa8cadb1c8..0b76a34d577 100755 --- a/test/e2e_node/conformance/run_test.sh +++ b/test/e2e_node/conformance/run_test.sh @@ -120,7 +120,7 @@ start_kubelet() { # we want to run this command as root but log the file to a normal user file # (so disable SC2024) # shellcheck disable=SC2024 - if ! sudo -b "${KUBELET}" "$@" &>"${LOG_DIR}/${kubelet_log}"; then + if ! sudo -b "${KUBELET}" "$@" &>"${LOG_DIR}/${kubelet_log}"; then echo "Failed to start kubelet" exit 1 fi