File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -448,10 +448,23 @@ function resumePatroni() {
448
448
449
449
log " Resuming Patroni cluster '${cluster} ' via pod ${pod} "
450
450
451
- until kubectl exec -n " ${namespace} " " ${pod} " -c patroni -- patronictl resume --wait > /dev/null 2>&1 ; do
452
- log " Resume failed in pod ${pod} . Retrying..."
451
+ until kubectl exec -n " ${namespace} " " ${pod} " -c patroni -- pg_isready & > /dev/null; do
452
+ log " PostgreSQL is not yet ready in pod ${pod} "
453
+
454
+ if (kubectl exec -n " ${namespace} " " ${pod} " -c patroni -- \
455
+ patronictl show-config | yq eval ' .pause' -e | grep -q true) & > /dev/null; then
456
+ log " Cluster is paused in pod ${pod} . Attempting to resume..."
457
+ if kubectl exec -n " ${namespace} " " ${pod} " -c patroni -- \
458
+ patronictl resume --wait & > /dev/null; then
459
+ log " Successfully resumed cluster in pod ${pod} "
460
+ else
461
+ log " Resume failed in pod ${pod} . Retrying"
462
+ fi
463
+ fi
453
464
sleep 2
454
465
done
466
+
467
+ log " Successfully resumed cluster in pod ${pod} "
455
468
}
456
469
457
470
function waitForStatefulSetPodsStarted() {
You can’t perform that action at this time.
0 commit comments