Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions e2e-tests/functions
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Loading