Skip to content

Commit a723b2f

Browse files
fix
Signed-off-by: Nikita Korolev <[email protected]>
1 parent 6cdf66a commit a723b2f

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

tests/performance/vd-pvc-snapshot.sh

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,6 @@ formatted_date() {
4949
esac
5050
}
5151

52-
get_current_date() {
53-
date +"%Y-%m-%d %H:%M:%S"
54-
}
55-
5652
get_current_date() {
5753
date +"%H:%M:%S %d-%m-%Y"
5854
}
@@ -275,22 +271,23 @@ main(){
275271

276272
log_info "Create persistent volume claim 1000"
277273
for i in $(seq 0 $(($pvc_count-1)) ); do
278-
pvc_name=$(printf "%-6s-%05d\n" ${PVC_NAME} ${i})
274+
pvc_name=$(printf "%s-%05d" ${PVC_NAME} ${i})
279275
create_pvc ${pvc_name} ${VS_NAME} ${NAMESPACE} ${SC}
280276
done
281277

282278
log_info "Wait for bound"
283-
local bount_start=$(get_timestamp)
279+
local bound_start=$(get_timestamp)
284280
while true; do
285281
log_info "Waiting for bound"
286282
sleep ${SLEEP_TIME}
283+
pvc_bound=0
287284
for i in $(seq 0 $((pvc_count - 1))); do
288-
pvc_name=$(printf "%-6s-%05d\n" ${PVC_NAME} ${i})
289-
bound=$(kubectl -n ${NAMESPACE} get pvc ${pvc_name} -o jsonpath='{.status.phase}')
285+
pvc_name=$(printf "%s-%05d" ${PVC_NAME} ${i})
286+
bound=$(kubectl -n ${NAMESPACE} get pvc ${pvc_name} -o jsonpath='{.status.phase}' 2>/dev/null)
287+
if [ "$bound" == "Bound" ]; then
288+
((pvc_bound++))
289+
fi
290290
done
291-
if [ "$bound" == "Bound" ]; then
292-
((pvc_bound++))
293-
fi
294291

295292
if [ $pvc_bound -eq $pvc_count ]; then
296293
local end_time=$(get_timestamp)
@@ -304,7 +301,7 @@ main(){
304301
break
305302
fi
306303

307-
log_info "Waiting for bound... $bound/$pvc_count"
304+
log_info "Waiting for bound... $pvc_bound/$pvc_count"
308305

309306
done
310307

0 commit comments

Comments
 (0)