ashb commented on a change in pull request #9332:
URL: https://github.com/apache/airflow/pull/9332#discussion_r440996421
##########
File path: scripts/ci/libraries/_kind.sh
##########
@@ -392,9 +397,9 @@ function wait_for_airflow_pods_up_and_running() {
echo "------- Running kubectl get pods: $i -------"
PODS=$(kubectl get pods --cluster "${KUBECTL_CLUSTER_NAME}" | awk
'NR>1 {print $0}')
echo "$PODS"
- NUM_AIRFLOW_READY=$(echo "${PODS}" | grep airflow | awk '{print $2}' |
grep -cE '([0-9])\/(\1)' \
+ NUM_AIRFLOW_READY=$(echo "${PODS}" | grep airflow | awk '{print $2}' |
grep -cE '([2-9])\/(\1)' \
| xargs)
- NUM_POSTGRES_READY=$(echo "${PODS}" | grep postgres | awk '{print $2}'
| grep -cE '([0-9])\/(\1)' \
+ NUM_POSTGRES_READY=$(echo "${PODS}" | grep postgres | awk '{print $2}'
| grep -cE '([1-9])\/(\1)' \
Review comment:
I don't think `0/2` would match this:
```bash console
$ echo 'airflow-r7x5g 1/1 Running 0 27d' | grep airflow |
awk '{print $2}' | grep -cE '([0-9])\/(\1)' | xargs
1
$ echo 'airflow-r7x5g 1/2 Running 0 27d' | grep airflow |
awk '{print $2}' | grep -cE '([0-9])\/(\1)' | xargs
0
$ echo 'airflow-r7x5g 0/2 Running 0 27d' | grep airflow |
awk '{print $2}' | grep -cE '([0-9])\/(\1)' | xargs
0
$ echo 'airflow-r7x5g 2/2 Running 0 27d' | grep airflow |
awk '{print $2}' | grep -cE '([0-9])\/(\1)' | xargs
1
```
So it returns `1` iff all pods are in the running state. (We test the
values captured are `== 1` on L404)
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]