@@ -20,7 +20,7 @@ set -o errexit
20
20
set -o nounset
21
21
set -o pipefail
22
22
23
- KUBE_ROOT=$( dirname " ${BASH_SOURCE} " ) /..
23
+ KUBE_ROOT=$( dirname " ${BASH_SOURCE[0] } " ) /..
24
24
source " ${KUBE_ROOT} /hack/lib/init.sh"
25
25
26
26
# The api version in which objects are currently stored in etcd.
@@ -67,7 +67,7 @@ function startApiServer() {
67
67
--cert-dir=" ${TMPDIR:-/ tmp/ } " \
68
68
--service-cluster-ip-range=" 10.0.0.0/24" \
69
69
--storage-versions=" ${storage_versions} " \
70
- --storage-media-type=${storage_media_type} 1>&2 &
70
+ --storage-media-type=" ${storage_media_type} " 1>&2 &
71
71
APISERVER_PID=$!
72
72
73
73
# url, prefix, wait, times
@@ -103,7 +103,7 @@ echo "${ETCD_VERSION}" > "${ETCD_DIR}/version.txt"
103
103
104
104
# source_file,resource,namespace,name,old_version,new_version
105
105
tests=(
106
- test/e2e/testing-manifests/rbd-storage-class.yaml,storageclasses,,slow,v1beta1,v1
106
+ " test/e2e/testing-manifests/rbd-storage-class.yaml,storageclasses,,slow,v1beta1,v1"
107
107
)
108
108
109
109
KUBE_OLD_API_VERSION=" networking.k8s.io/v1,storage.k8s.io/v1beta1,extensions/v1beta1"
@@ -123,7 +123,7 @@ startApiServer ${KUBE_OLD_STORAGE_VERSIONS} ${KUBE_STORAGE_MEDIA_TYPE_JSON}
123
123
124
124
125
125
# Create object(s)
126
- for test in ${tests[@]} ; do
126
+ for test in " ${tests[@]} " ; do
127
127
IFS=' ,' read -ra test_data <<< " $test"
128
128
source_file=${test_data[0]}
129
129
@@ -140,7 +140,7 @@ for test in ${tests[@]}; do
140
140
namespace=" ${namespace} /"
141
141
fi
142
142
kube::log::status " Verifying ${resource} /${namespace}${name} has storage version ${old_storage_version} in etcd"
143
- ETCDCTL_API=3 ${ETCDCTL} --endpoints=" http://${ETCD_HOST} :${ETCD_PORT} " get " /${ETCD_PREFIX} /${resource} /${namespace}${name} " | grep ${old_storage_version}
143
+ ETCDCTL_API=3 ${ETCDCTL} --endpoints=" http://${ETCD_HOST} :${ETCD_PORT} " get " /${ETCD_PREFIX} /${resource} /${namespace}${name} " | grep " ${old_storage_version} "
144
144
done
145
145
146
146
killApiServer
@@ -160,7 +160,7 @@ kube::log::status "Updating storage versions in etcd"
160
160
${UPDATE_ETCD_OBJECTS_SCRIPT}
161
161
162
162
# Verify that the storage version was changed in etcd
163
- for test in ${tests[@]} ; do
163
+ for test in " ${tests[@]} " ; do
164
164
IFS=' ,' read -ra test_data <<< " $test"
165
165
resource=${test_data[1]}
166
166
namespace=${test_data[2]}
@@ -171,7 +171,7 @@ for test in ${tests[@]}; do
171
171
namespace=" ${namespace} /"
172
172
fi
173
173
kube::log::status " Verifying ${resource} /${namespace}${name} has updated storage version ${new_storage_version} in etcd"
174
- ETCDCTL_API=3 ${ETCDCTL} --endpoints=" http://${ETCD_HOST} :${ETCD_PORT} " get " /${ETCD_PREFIX} /${resource} /${namespace}${name} " | grep ${new_storage_version}
174
+ ETCDCTL_API=3 ${ETCDCTL} --endpoints=" http://${ETCD_HOST} :${ETCD_PORT} " get " /${ETCD_PREFIX} /${resource} /${namespace}${name} " | grep " ${new_storage_version} "
175
175
done
176
176
177
177
killApiServer
@@ -188,7 +188,7 @@ RUNTIME_CONFIG="api/all=false,api/v1=true,apiregistration.k8s.io/v1=true,${KUBE_
188
188
sleep 1
189
189
startApiServer ${KUBE_NEW_STORAGE_VERSIONS} ${KUBE_STORAGE_MEDIA_TYPE_PROTOBUF}
190
190
191
- for test in ${tests[@]} ; do
191
+ for test in " ${tests[@]} " ; do
192
192
IFS=' ,' read -ra test_data <<< " $test"
193
193
resource=${test_data[1]}
194
194
namespace=${test_data[2]}
@@ -203,8 +203,8 @@ for test in ${tests[@]}; do
203
203
kube::log::status " Verifying we can retrieve ${resource} /${namespace}${name} via kubectl"
204
204
# We have to remove the cached discovery information about the old version; otherwise,
205
205
# the 'kubectl get' will use that and fail to find the resource.
206
- rm -rf ${HOME} /.kube/cache/discovery/localhost_8080/${KUBE_OLD_STORAGE_VERSIONS}
207
- ${KUBECTL} get ${namespace_flag} ${resource} /${name}
206
+ rm -rf " ${HOME} /.kube/cache/discovery/localhost_8080/${KUBE_OLD_STORAGE_VERSIONS} "
207
+ ${KUBECTL} get " ${namespace_flag} " " ${resource} /${name} "
208
208
done
209
209
210
210
killApiServer
0 commit comments