diff --git a/e2e-tests/functions b/e2e-tests/functions index 08c65e876..a2cd3b365 100644 --- a/e2e-tests/functions +++ b/e2e-tests/functions @@ -1036,16 +1036,22 @@ get_desired_replicas() { kubectl get statefulset "$1" -n "$NAMESPACE" -o jsonpath='{.spec.replicas}' } +get_ready_replicas() { + kubectl get sts "$1" -n "$NAMESPACE" -o jsonpath='{.status.readyReplicas}' +} + wait_sts_rollout() { local sts=$1 + local ready_replicas=$(get_ready_replicas $sts) local updated_replicas=$(get_updated_replicas $sts) local desired_replicas=$(get_desired_replicas $sts) + echo "ready_replicas $ready_replicas desired_replicas $desired_replicas" - until [[ $updated_replicas -eq $desired_replicas ]]; do - updated_replicas=$(get_updated_replicas $sts) + until [[ $ready_replicas -eq $desired_replicas && $updated_replicas -eq $desired_replicas ]]; do + ready_replicas=$(get_ready_replicas $sts) desired_replicas=$(get_desired_replicas $sts) - - echo "Waiting for sts/$sts to update... $updated_replicas/$desired_replicas pods updated." + updated_replicas=$(get_updated_replicas $sts) + echo "Waiting for sts/$sts to update... $ready_replicas/$updated_replicas/$desired_replicas pods updated." sleep 10 done }