@@ -18,7 +18,7 @@ set -o errexit
18
18
set -o nounset
19
19
set -o pipefail
20
20
21
- KUBE_ROOT=$( dirname " ${BASH_SOURCE} " ) /..
21
+ KUBE_ROOT=$( dirname " ${BASH_SOURCE[0] } " ) /..
22
22
source " ${KUBE_ROOT} /cluster/common.sh"
23
23
source " ${KUBE_ROOT} /hack/lib/init.sh"
24
24
@@ -38,8 +38,8 @@ GINKGO_NO_COLOR=${GINKGO_NO_COLOR:-n}
38
38
# If 'y', will rerun failed tests once to give them a second chance.
39
39
GINKGO_TOLERATE_FLAKES=${GINKGO_TOLERATE_FLAKES:- n}
40
40
41
- : ${KUBECTL:= " ${KUBE_ROOT} /cluster/kubectl.sh" }
42
- : ${KUBE_CONFIG_FILE:= " config-test.sh" }
41
+ : " ${KUBECTL:= " ${KUBE_ROOT} /cluster/kubectl.sh" } "
42
+ : " ${KUBE_CONFIG_FILE:= " config-test.sh" } "
43
43
44
44
export KUBECTL KUBE_CONFIG_FILE
45
45
@@ -48,11 +48,13 @@ source "${KUBE_ROOT}/cluster/kube-util.sh"
48
48
function detect-master-from-kubeconfig() {
49
49
export KUBECONFIG=${KUBECONFIG:- $DEFAULT_KUBECONFIG }
50
50
51
- local cc=$( " ${KUBE_ROOT} /cluster/kubectl.sh" config view -o jsonpath=" {.current-context}" )
52
- if [[ ! -z " ${KUBE_CONTEXT:- } " ]]; then
51
+ local cc
52
+ cc=$( " ${KUBE_ROOT} /cluster/kubectl.sh" config view -o jsonpath=" {.current-context}" )
53
+ if [[ -n " ${KUBE_CONTEXT:- } " ]]; then
53
54
cc=" ${KUBE_CONTEXT} "
54
55
fi
55
- local cluster=$( " ${KUBE_ROOT} /cluster/kubectl.sh" config view -o jsonpath=" {.contexts[?(@.name == \" ${cc} \" )].context.cluster}" )
56
+ local cluster
57
+ cluster=$( " ${KUBE_ROOT} /cluster/kubectl.sh" config view -o jsonpath=" {.contexts[?(@.name == \" ${cc} \" )].context.cluster}" )
56
58
KUBE_MASTER_URL=$( " ${KUBE_ROOT} /cluster/kubectl.sh" config view -o jsonpath=" {.clusters[?(@.name == \" ${cluster} \" )].cluster.server}" )
57
59
}
58
60
86
88
if [[ " ${KUBERNETES_PROVIDER} " == " gce" ]]; then
87
89
set_num_migs
88
90
NODE_INSTANCE_GROUP=" "
89
- for (( i= 1 ; i<= ${ NUM_MIGS} ; i++ )) ; do
90
- if [[ ${i} == ${NUM_MIGS} ]]; then
91
+ for (( i= 1 ; i<= NUM_MIGS; i++ )) ; do
92
+ if [[ ${i} == " ${NUM_MIGS} " ]]; then
91
93
# We are assigning the same mig names as create-nodes function from cluster/gce/util.sh.
92
94
NODE_INSTANCE_GROUP=" ${NODE_INSTANCE_GROUP}${NODE_INSTANCE_PREFIX} -group"
93
95
else
101
103
# KUBERNETES_CONFORMANCE_PROVIDER is set to "gke".
102
104
if [[ -z " ${NODE_INSTANCE_GROUP:- } " ]] && [[ " ${KUBERNETES_PROVIDER} " == " gke" ]]; then
103
105
detect-node-instance-groups
104
- NODE_INSTANCE_GROUP=$( kube::util::join , " ${NODE_INSTANCE_GROUPS [@]} " )
106
+ NODE_INSTANCE_GROUP=$( kube::util::join , " ${NODE_INSTANCE_GROUP [@]} " )
105
107
fi
106
108
107
109
if [[ " ${KUBERNETES_PROVIDER} " == " azure" ]]; then
138
140
# The --host setting is used only when providing --auth_config
139
141
# If --kubeconfig is used, the host to use is retrieved from the .kubeconfig
140
142
# file and the one provided with --host is ignored.
141
- # Add path for things like running kubectl binary.
142
- export PATH=$( dirname " ${e2e_test} " ) :" ${PATH} "
143
+ # Add path for things like running kubectl binary.
144
+ PATH=$( dirname " ${e2e_test} " ) :" ${PATH} "
145
+ export PATH
143
146
" ${ginkgo} " " ${ginkgo_args[@]: +${ginkgo_args[@]} } " " ${e2e_test} " -- \
144
147
" ${auth_config[@]: +${auth_config[@]} } " \
145
148
--ginkgo.flakeAttempts=" ${FLAKE_ATTEMPTS} " \
0 commit comments