File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -1036,16 +1036,22 @@ get_desired_replicas() {
10361036 kubectl get statefulset " $1 " -n " $NAMESPACE " -o jsonpath=' {.spec.replicas}'
10371037}
10381038
1039+ get_ready_replicas () {
1040+ kubectl get sts " $1 " -n " $NAMESPACE " -o jsonpath=' {.status.readyReplicas}'
1041+ }
1042+
10391043wait_sts_rollout () {
10401044 local sts=$1
1045+ local ready_replicas=$( get_ready_replicas $sts )
10411046 local updated_replicas=$( get_updated_replicas $sts )
10421047 local desired_replicas=$( get_desired_replicas $sts )
1048+ echo " ready_replicas $ready_replicas desired_replicas $desired_replicas "
10431049
1044- until [[ $updated_replicas -eq $desired_replicas ]]; do
1045- updated_replicas =$( get_updated_replicas $sts )
1050+ until [[ $ready_replicas -eq $desired_replicas && $ updated_replicas -eq $desired_replicas ]]; do
1051+ ready_replicas =$( get_ready_replicas $sts )
10461052 desired_replicas=$( get_desired_replicas $sts )
1047-
1048- echo " Waiting for sts/$sts to update... $updated_replicas /$desired_replicas pods updated."
1053+ updated_replicas= $( get_updated_replicas $sts )
1054+ echo " Waiting for sts/$sts to update... $ready_replicas / $ updated_replicas /$desired_replicas pods updated."
10491055 sleep 10
10501056 done
10511057}
You can’t perform that action at this time.
0 commit comments