feat: script the restore test, and fix the runbook it came from #33

Merged
ivuorinen merged 2 commits from docs/restore-runbook into main 2026-09-21 19:27:12 +00:00
Owner
No description provided.
fix: treat acme.sh exit 2 as success, not failure
All checks were successful
validate / hooks (pull_request) Successful in 1m43s
validate / render (pull_request) Successful in 43s
ae2eccf46a
acme.sh exits 2 (RENEW_SKIP) when the certificate is still valid and the renewal window has not opened: "Domains not changed. Skipping. Next renewal time is: 2026-11-19". With state now persisted that is the expected outcome of almost every run, and the wrapper failed the Job on any non-zero exit.

The first correctly-skipping run therefore failed, and would have failed every week until November, firing CertRenewalJobFailing and KubeJobFailed for a certificate that was in perfect health. The bug could not exist before #30: without persisted state every run re-issued and exited 0.

0 and 2 are now success, anything else fails. --install-cert runs in both cases, so the Secret is reconciled even when nothing was renewed — which also means a Secret deleted by hand comes back on the next weekly run rather than at the next renewal.
feat: script the restore test, and fix the runbook it came from
All checks were successful
validate / hooks (pull_request) Successful in 1m18s
validate / render (pull_request) Successful in 34s
c809fa5e5b
Restoring is two actions in the Longhorn UI and the second is easy to miss: a restore produces a Longhorn volume, which Kubernetes cannot see until it has a PV and a PVC. Both attempts at the first restore test here stalled on a pod stuck Pending with 'persistentvolumeclaim not found'. The runbook said 'create its PV/PVC' in passing and said nothing about the Create PV/PVC dialog pre-filling the *source* volume's PVC name — which, in a test against a live volume, is the name the workload is still using.

scripts/restore-test.sh does the whole thing: resolves the volume behind a PVC, picks the newest completed backup, restores it, creates the PV and PVC, compares every file by checksum against the live volume, and deletes what it made. It refuses to run unless the live volume is detached, since both claims are ReadWriteOnce, and only deletes objects it labelled itself.

It treats two empty volumes as a failure rather than a match. That case is not hypothetical: the first run of this test compared an empty acme-state against an empty restore of it and reported success, which is how the --config-home bug (#30) was found.

Claude-Session: https://claude.ai/code/session_012QmTCoCVY9Eqsff4RBS6PL
ivuorinen deleted branch docs/restore-runbook 2026-09-21 19:27:12 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ivuorinen/turingpi-cluster!33
No description provided.