fix: treat acme.sh exit 2 as success, not failure #31

Merged
ivuorinen merged 1 commit from fix/acme-renew-skip into main 2026-09-21 04:33:54 +00:00
Owner

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.

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.
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.
ivuorinen deleted branch fix/acme-renew-skip 2026-09-21 04:33:55 +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!31
No description provided.