GeorgeJahad commented on code in PR #5028:
URL: https://github.com/apache/ozone/pull/5028#discussion_r1254908086
##########
hadoop-ozone/dist/src/main/k8s/examples/testlib.sh:
##########
@@ -47,23 +48,29 @@ wait_for_startup(){
}
all_pods_are_running() {
- RUNNING_COUNT=$(kubectl get pod --field-selector status.phase=Running | wc
-l)
- ALL_COUNT=$(kubectl get pod | wc -l)
- RUNNING_COUNT=$((RUNNING_COUNT - 1))
- ALL_COUNT=$((ALL_COUNT - 1))
- if [ "$RUNNING_COUNT" -lt "3" ]; then
- echo "$RUNNING_COUNT pods are running. Waiting for more."
+ local -i running=$(kubectl get pod --field-selector status.phase=Running |
grep -v 'STATUS' | wc -l)
+ local -i all=$(kubectl get pod | grep -v 'STATUS' | wc -l)
+ if [ "$running" -lt "3" ]; then
+ echo "$running pods are running. Waiting for more."
return 1
- elif [ "$RUNNING_COUNT" -ne "$ALL_COUNT" ]; then
- echo "$RUNNING_COUNT pods are running out from the $ALL_COUNT"
+ elif [ "$running" -ne "$all" ]; then
+ echo "$running pods are running out from the $all"
Review Comment:
yes, that is good too. I just found the current message confusing and had
to read it a couple of times to follow it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]