mirror of
https://github.com/dredx/prole.git
synced 2026-09-23 11:03:59 +00:00
fix(cnpg-backup/k3d): skip re-init when already healthy; add breadcrumb
This commit is contained in:
parent
de1a04c0fb
commit
a9b11f3ee6
@ -967,6 +967,16 @@ case "$ACTION" in
|
||||
ensure_namespace
|
||||
wait_for_apiserver_ready 180
|
||||
ensure_cluster
|
||||
# Fast-path: skip re-initialization when continuous archiving is already healthy
|
||||
# and at least one successful base backup exists. All the wait_for_* loops below
|
||||
# are idempotent but slow — no need to re-run them on every installer pass.
|
||||
_ca_status_fp=$(kubectl -n "$NAMESPACE" get cluster "$CNPG_CLUSTER_NAME" \
|
||||
-o jsonpath='{range .status.conditions[?(@.type=="ContinuousArchiving")]}{.status}{end}' \
|
||||
2>/dev/null || true)
|
||||
if [[ "$_ca_status_fp" == "True" ]] && has_successful_base_backup; then
|
||||
echo "[CNPG BACKUP] Continuous archiving healthy and base backup exists — skipping re-initialization."
|
||||
exit 0
|
||||
fi
|
||||
resolve_garage_namespace_and_endpoint
|
||||
ensure_garage_bucket_and_key
|
||||
wait_for_barman_plugin_infra_ready
|
||||
|
||||
@ -683,6 +683,9 @@ class ServicesScreenMixin:
|
||||
# 3. CloudNative-PG initialization (Python)
|
||||
cnpg_script = "init_cloudnative_pg.sh"
|
||||
if overall_success:
|
||||
_con("init_monitoring.sh").write(
|
||||
"\nMonitoring done — running database initialization (see Database tab)...\n"
|
||||
)
|
||||
_select_tab(cnpg_script)
|
||||
_con(cnpg_script).clear()
|
||||
_con(cnpg_script).write("Running CloudNative-PG initialization...\n")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user