mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-10-31 18:28:13 +00:00 
			
		
		
		
	*.sh: cleanup all white noise
Signed-off-by: Xiang Dai <long0dai@foxmail.com>
This commit is contained in:
		| @@ -147,7 +147,7 @@ function download_tarball() { | |||||||
|   local -r download_path="$1" |   local -r download_path="$1" | ||||||
|   local -r file="$2" |   local -r file="$2" | ||||||
|   local trace_on="off" |   local trace_on="off" | ||||||
|   if [[ -o xtrace ]]; then  |   if [[ -o xtrace ]]; then | ||||||
|     trace_on="on" |     trace_on="on" | ||||||
|     set +x |     set +x | ||||||
|   fi |   fi | ||||||
|   | |||||||
| @@ -37,7 +37,7 @@ saveResults() { | |||||||
| } | } | ||||||
|  |  | ||||||
| # Optional Golang runner alternative to the bash script. | # 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 | if [[ -n ${E2E_USE_GO_RUNNER:-} ]]; then | ||||||
|     set -x |     set -x | ||||||
|     /gorunner && ret=0 || ret=$? |     /gorunner && ret=0 || ret=$? | ||||||
|   | |||||||
| @@ -31,7 +31,7 @@ TEST_CLUSTER_LOG_LEVEL="${TEST_CLUSTER_LOG_LEVEL:-"--v=4"}" | |||||||
| KUBE_GCE_INSTANCE_PREFIX="${KUBE_GCE_INSTANCE_PREFIX:-"default"}" | 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 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} | NUM_WINDOWS_NODES=${KUBEMARK_NUM_WINDOWS_NODES:-0} | ||||||
|  |  | ||||||
| HOLLOW_KUBELET_TEST_LOG_LEVEL="${HOLLOW_KUBELET_TEST_LOG_LEVEL:-$TEST_CLUSTER_LOG_LEVEL}" | HOLLOW_KUBELET_TEST_LOG_LEVEL="${HOLLOW_KUBELET_TEST_LOG_LEVEL:-$TEST_CLUSTER_LOG_LEVEL}" | ||||||
|   | |||||||
| @@ -270,7 +270,7 @@ function save-windows-logs-via-ssh() { | |||||||
|  |  | ||||||
|     export-windows-docker-event-log "${node}" |     export-windows-docker-event-log "${node}" | ||||||
|     export-windows-docker-images-list "${node}" |     export-windows-docker-images-list "${node}" | ||||||
|      |  | ||||||
|     local remote_files=() |     local remote_files=() | ||||||
|     for file in ${windows_node_logfiles[@]}; do |     for file in ${windows_node_logfiles[@]}; do | ||||||
|       remote_files+=( "${WINDOWS_LOGS_DIR}\\${file}" ) |       remote_files+=( "${WINDOWS_LOGS_DIR}\\${file}" ) | ||||||
|   | |||||||
| @@ -147,7 +147,7 @@ fi | |||||||
| # The --host setting is used only when providing --auth_config | # The --host setting is used only when providing --auth_config | ||||||
| # If --kubeconfig is used, the host to use is retrieved from the .kubeconfig | # If --kubeconfig is used, the host to use is retrieved from the .kubeconfig | ||||||
| # file and the one provided with --host is ignored. | # 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}" | PATH=$(dirname "${e2e_test}"):"${PATH}" | ||||||
| export PATH | export PATH | ||||||
| "${ginkgo}" "${ginkgo_args[@]:+${ginkgo_args[@]}}" "${e2e_test}" -- \ | "${ginkgo}" "${ginkgo_args[@]:+${ginkgo_args[@]}}" "${e2e_test}" -- \ | ||||||
|   | |||||||
| @@ -213,7 +213,7 @@ kube::util::find-binary-for-platform() { | |||||||
|     locations+=("$location"); |     locations+=("$location"); | ||||||
|   done < <(find "${KUBE_ROOT}/bazel-bin/" -type f -perm -111 \ |   done < <(find "${KUBE_ROOT}/bazel-bin/" -type f -perm -111 \ | ||||||
|     \( -path "*/${platform/\//_}*/${lookfor}" -o -path "*/${lookfor}" \) 2>/dev/null || true) |     \( -path "*/${platform/\//_}*/${lookfor}" -o -path "*/${lookfor}" \) 2>/dev/null || true) | ||||||
|    |  | ||||||
|   # List most recently-updated location. |   # List most recently-updated location. | ||||||
|   local -r bin=$( (ls -t "${locations[@]}" 2>/dev/null || true) | head -1 ) |   local -r bin=$( (ls -t "${locations[@]}" 2>/dev/null || true) | head -1 ) | ||||||
|   echo -n "${bin}" |   echo -n "${bin}" | ||||||
|   | |||||||
| @@ -76,8 +76,8 @@ for forbidden_repo in "${forbidden_repos[@]}"; do | |||||||
| done | done | ||||||
|  |  | ||||||
| outdated=$(go list -m -json all | jq -r " | outdated=$(go list -m -json all | jq -r " | ||||||
|   select(.Replace.Version != null) |  |   select(.Replace.Version != null) | | ||||||
|   select(.Version != .Replace.Version) |  |   select(.Version != .Replace.Version) | | ||||||
|   ${filter} |   ${filter} | ||||||
|   select(.Path) | |   select(.Path) | | ||||||
|   \"\(.Path) |   \"\(.Path) | ||||||
|   | |||||||
| @@ -76,7 +76,7 @@ function run_kube_apiserver() { | |||||||
| } | } | ||||||
|  |  | ||||||
| # Runs run_kube_controller_manager | # Runs run_kube_controller_manager | ||||||
| #  | # | ||||||
| # Exports: | # Exports: | ||||||
| #   CTLRMGR_PID | #   CTLRMGR_PID | ||||||
| function run_kube_controller_manager() { | 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 | # Creates a node object with name 127.0.0.1. This is required because we do not | ||||||
| # run kubelet. | # run kubelet. | ||||||
| #  | # | ||||||
| # Exports: | # Exports: | ||||||
| #   SUPPORTED_RESOURCES(Array of all resources supported by the apiserver). | #   SUPPORTED_RESOURCES(Array of all resources supported by the apiserver). | ||||||
| function create_node() { | function create_node() { | ||||||
| @@ -121,7 +121,7 @@ __EOF__ | |||||||
| # 2) $WHAT is not empty and kubeadm is part of $WHAT | # 2) $WHAT is not empty and kubeadm is part of $WHAT | ||||||
| WHAT=${WHAT:-} | WHAT=${WHAT:-} | ||||||
| if [[ ${WHAT} == "" || ${WHAT} =~ .*kubeadm.* ]] ; then | if [[ ${WHAT} == "" || ${WHAT} =~ .*kubeadm.* ]] ; then | ||||||
|   kube::log::status "Running kubeadm tests"   |   kube::log::status "Running kubeadm tests" | ||||||
|  |  | ||||||
|   # build kubeadm |   # build kubeadm | ||||||
|   make all -C "${KUBE_ROOT}" WHAT=cmd/kubeadm |   make all -C "${KUBE_ROOT}" WHAT=cmd/kubeadm | ||||||
|   | |||||||
| @@ -55,7 +55,7 @@ if [[ ! -d "${artifacts}" ]]; then | |||||||
| fi | fi | ||||||
| echo "Test artifacts will be written to ${artifacts}" | echo "Test artifacts will be written to ${artifacts}" | ||||||
|  |  | ||||||
| # Test  | # Test | ||||||
| kube::golang::verify_go_version | kube::golang::verify_go_version | ||||||
|  |  | ||||||
| go run test/e2e_kubeadm/runner/local/run_local.go \ | go run test/e2e_kubeadm/runner/local/run_local.go \ | ||||||
|   | |||||||
| @@ -46,7 +46,7 @@ extra_envs=${EXTRA_ENVS:-} | |||||||
|  |  | ||||||
| # Parse the flags to pass to ginkgo | # Parse the flags to pass to ginkgo | ||||||
| ginkgoflags="" | ginkgoflags="" | ||||||
| if [[ ${parallelism} -gt 1 ]]; then   | if [[ ${parallelism} -gt 1 ]]; then | ||||||
|   ginkgoflags="${ginkgoflags} -nodes=${parallelism} " |   ginkgoflags="${ginkgoflags} -nodes=${parallelism} " | ||||||
| fi | fi | ||||||
|  |  | ||||||
|   | |||||||
| @@ -16,8 +16,8 @@ | |||||||
|  |  | ||||||
| # This script is a vestigial redirection.  Please do not add "real" logic. | # This script is a vestigial redirection.  Please do not add "real" logic. | ||||||
| # The "true" target of this makerule is `hack/make-rules/update.sh`. | # The "true" target of this makerule is `hack/make-rules/update.sh`. | ||||||
| # We should run `hack/update-all.sh` if anything fails after  | # We should run `hack/update-all.sh` if anything fails after | ||||||
| # running `hack/verify-all.sh`. It is equivalent to `make update`.  | # running `hack/verify-all.sh`. It is equivalent to `make update`. | ||||||
| # Usage: `hack/update-all.sh` or `make update`. | # Usage: `hack/update-all.sh` or `make update`. | ||||||
|  |  | ||||||
| set -o errexit | set -o errexit | ||||||
|   | |||||||
| @@ -62,7 +62,7 @@ done | |||||||
|  |  | ||||||
| # Run gazelle to update Go rules in BUILD files. | # Run gazelle to update Go rules in BUILD files. | ||||||
| # filter out known pkg-config error (see buildozer workaround below) | # 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 | # while preserving the exit code of gazelle | ||||||
| gazelle fix \ | gazelle fix \ | ||||||
|     -external=vendored \ |     -external=vendored \ | ||||||
|   | |||||||
| @@ -14,7 +14,7 @@ | |||||||
| # See the License for the specific language governing permissions and | # See the License for the specific language governing permissions and | ||||||
| # limitations under the License. | # 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). | # all the imports that we have our preferred alias(es). | ||||||
| # Usage: `hack/update-import-aliases.sh`. | # Usage: `hack/update-import-aliases.sh`. | ||||||
|  |  | ||||||
|   | |||||||
| @@ -14,8 +14,8 @@ | |||||||
| # See the License for the specific language governing permissions and | # See the License for the specific language governing permissions and | ||||||
| # limitations under the License. | # limitations under the License. | ||||||
|  |  | ||||||
| # This script updates `translations/kubectl/template.pot` for  | # This script updates `translations/kubectl/template.pot` for | ||||||
| # `pkg/kubectl/cmd/*.go pkg/kubectl/cmd/*/*.go`.  | # `pkg/kubectl/cmd/*.go pkg/kubectl/cmd/*/*.go`. | ||||||
| # Usage: `update-translations.sh`. | # Usage: `update-translations.sh`. | ||||||
|  |  | ||||||
| KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. | KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. | ||||||
|   | |||||||
| @@ -120,7 +120,7 @@ start_kubelet() { | |||||||
|   # we want to run this command as root but log the file to a normal user file |   # we want to run this command as root but log the file to a normal user file | ||||||
|   # (so disable SC2024) |   # (so disable SC2024) | ||||||
|   # shellcheck 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" |     echo "Failed to start kubelet" | ||||||
|     exit 1 |     exit 1 | ||||||
|   fi |   fi | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Xiang Dai
					Xiang Dai