*.sh: cleanup all white noise

Signed-off-by: Xiang Dai <long0dai@foxmail.com>
This commit is contained in:
Xiang Dai 2020-05-29 09:56:00 +08:00
parent 0891f69f5e
commit e09bc312cb
15 changed files with 20 additions and 20 deletions

View File

@ -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

View File

@ -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=$?

View File

@ -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}"

View File

@ -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}" )

View File

@ -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}" -- \

View File

@ -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}"

View File

@ -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)

View File

@ -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

View File

@ -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 \

View File

@ -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

View File

@ -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

View File

@ -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 \

View File

@ -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`.

View File

@ -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]}")/..

View File

@ -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