Skip to content

Commit ee50d47

Browse files
authored
Merge pull request kubernetes#74193 from xichengliudui/fixshellcheck19021802
fix shellcheck in test/integration/... and test/kubemark/...
2 parents e67562d + 641f883 commit ee50d47

File tree

5 files changed

+11
-15
lines changed

5 files changed

+11
-15
lines changed

hack/.shellcheck_failures

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,16 +199,12 @@
199199
./test/images/volume/rbd/create_block.sh
200200
./test/images/volume/rbd/mon.sh
201201
./test/images/volume/rbd/osd.sh
202-
./test/integration/ipamperf/test-performance.sh
203-
./test/integration/scheduler_perf/test-performance.sh
204202
./test/kubemark/common/util.sh
205-
./test/kubemark/configure-kubectl.sh
206203
./test/kubemark/gce/util.sh
207204
./test/kubemark/iks/shutdown.sh
208205
./test/kubemark/iks/startup.sh
209206
./test/kubemark/iks/util.sh
210207
./test/kubemark/master-log-dump.sh
211-
./test/kubemark/pre-existing/util.sh
212208
./test/kubemark/resources/start-kubemark-master.sh
213209
./test/kubemark/run-e2e-tests.sh
214210
./test/kubemark/start-kubemark.sh

test/integration/ipamperf/test-performance.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,13 @@ while getopts ":hdr:o:p:ca:k:n:m:l:" opt; do
6767
esac
6868
done
6969

70-
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../../../
70+
KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/../../../
7171
source "${KUBE_ROOT}/hack/lib/init.sh"
7272

7373
kube::golang::setup_env
7474

75-
DIR_BASENAME=$(dirname "${BASH_SOURCE}")
76-
pushd ${DIR_BASENAME}
75+
DIR_BASENAME=$(dirname "${BASH_SOURCE[0]}")
76+
pushd "${DIR_BASENAME}"
7777

7878
cleanup() {
7979
popd 2> /dev/null
@@ -87,5 +87,5 @@ kube::etcd::start
8787

8888
# Running IPAM tests. It might take a long time.
8989
kube::log::status "performance test (IPAM) start"
90-
go test ${PROFILE_OPTS} -test.run=${RUN_PATTERN} -test.timeout=60m -test.short=false -v -args ${TEST_ARGS}
90+
go test "${PROFILE_OPTS}" -test.run="${RUN_PATTERN}" -test.timeout=60m -test.short=false -v -args "${TEST_ARGS}"
9191
kube::log::status "... IPAM tests finished."

test/integration/scheduler_perf/test-performance.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ set -o errexit
1818
set -o nounset
1919
set -o pipefail
2020

21-
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../../../
21+
KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/../../../
2222
source "${KUBE_ROOT}/hack/lib/init.sh"
2323

2424
kube::golang::setup_env
2525

26-
DIR_BASENAME=$(dirname "${BASH_SOURCE}")
27-
pushd ${DIR_BASENAME}
26+
DIR_BASENAME=$(dirname "${BASH_SOURCE[0]}")
27+
pushd "${DIR_BASENAME}"
2828

2929
cleanup() {
3030
popd 2> /dev/null

test/kubemark/configure-kubectl.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@
1616

1717
# This script assumes that kubectl binary is present in PATH.
1818
kubectl config set-cluster hollow-cluster --server=http://localhost:8080 --insecure-skip-tls-verify=true
19-
kubectl config set-credentials $(whoami)
20-
kubectl config set-context hollow-context --cluster=hollow-cluster --user=$(whoami)
19+
kubectl config set-credentials "$(whoami)"
20+
kubectl config set-context hollow-context --cluster=hollow-cluster --user="$(whoami)"

test/kubemark/pre-existing/util.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../../..
17+
KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/../../..
1818

1919
source "${KUBE_ROOT}/test/kubemark/common/util.sh"
2020

@@ -23,5 +23,5 @@ source "${KUBE_ROOT}/test/kubemark/common/util.sh"
2323
function execute-cmd-on-pre-existing-master-with-retries() {
2424
IP_WITHOUT_PORT=$(echo "${MASTER_IP}" | cut -f 1 -d ':') || "${MASTER_IP}"
2525

26-
RETRIES="${2:-1}" run-cmd-with-retries ssh kubernetes@"${IP_WITHOUT_PORT}" $1
26+
RETRIES="${2:-1}" run-cmd-with-retries ssh kubernetes@"${IP_WITHOUT_PORT}" "${1}"
2727
}

0 commit comments

Comments
 (0)