Repository navigation
Conversation
… no Ready condition (cert-manager#9128) * fix(issuing): surface stalled CertificateRequest with failureTime but no Ready condition Motivation: A CertificateRequest that has status.failureTime set but no Ready condition leaves a Certificate stuck at Issuing=True with nothing to move it along. The issuing controller's wait branch for a nil Ready condition returns silently at debug level, and the requestmanager controller only deletes a request whose Ready condition reason is Failed, so a nil condition is never cleaned up. The in-tree issuers cannot produce this state (they set failureTime and the Ready condition in the same status update), but an external issuer or a partially applied status can, and until then the operator has no signal beyond one debug-level log line. Approach: In the issuing controller's nil-Ready-condition branch, add a narrower check for req.Status.FailureTime != nil. Only in that specific sub-case, log at Info level and emit a Warning Event ("Stalled") on the Certificate so the stall is visible via `kubectl describe certificate` and controller logs at default verbosity. The common case of a CertificateRequest simply still awaiting a Ready condition (no failureTime set) is unchanged and stays at debug level, so this does not add log or event noise to normal in-progress issuance. Control flow is unchanged in both branches (still returns nil); this is an observability-only change. Validation: Ran `go test -count=1 ./pkg/controller/certificates/issuing/...` (passes, includes an updated unit test that reproduces the exact state described in the issue: a CertificateRequest with status.failureTime set and status.conditions empty). Confirmed the updated test's event assertion fails without the code change (`got unexpected events, exp='[Warning Stalled ...]' got='[]'`) and passes with it, proving the fix. Also ran `go build ./...`, `go vet ./pkg/controller/certificates/issuing/...`, `gofmt -l` on both changed files, and `golangci-lint run -c .golangci.yaml ./pkg/controller/certificates/issuing/...` (0 issues). No live cluster or e2e run was performed; this change has no effect on reconciliation behaviour (both branches still return nil), so the unit test is sufficient to prove it. Report: cert-manager#9126 Signed-off-by: Pujitha Paladugu <[email protected]> * fix(issuing): address review feedback on stalled-request event Name the CertificateRequest and add a remediation hint to the Stalled event message, extract the "Stalled" reason into a package const matching sibling controllers, and restore test coverage for the no-failureTime/no-Ready path that was dropped when the Stalled case was added. Also reword the code comment and adjust the existing test's failureTime fixture for clarity. Signed-off-by: Pujitha Paladugu <[email protected]> * fix(issuing): log stalled-request state at error level Matches this file's existing convention for should-never-happen states (see the issuing-condition-missing check above it). Signed-off-by: Pujitha Paladugu <[email protected]> --------- Signed-off-by: Pujitha Paladugu <[email protected]> Co-authored-by: Pujitha Paladugu <[email protected]> (cherry picked from commit b620f04) Conflicts resolved by hand: release-1.21 does not have the reasonTemporaryCertificateFailed const or the key-mismatch test cases from cert-manager#9116, so only the reasonStalled const and the two test cases from this change were kept. Co-Authored-By: Claude Fable 5.1 <[email protected]> Signed-off-by: Richard Wall <[email protected]>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Closing. Nobody has reported hitting this state on 1.21, and #9128 only adds an Event and a log line to a path the in-tree issuers cannot reach. It will ship in v1.22.0. If someone does report the stall on 1.21, we can reopen this; the conflicts are already resolved on the branch. [Claude Fable 5.1] |
|
We’ve now observed this stall on cert-manager v1.21.2, using the in-tree SelfSigned issuer. Could we reopen this and revisit the backport @wallrj ? Environment
LogsOn 2026-10-27 at 20:04:26 UTC, these messages appeared within the same second. Excerpts: Events also recorded two generated temporary key Secrets: capi-serving-cert-6gj5v and capi-serving-cert-zvd85. Resulting stallThe Certificate remained: The target Secret, capi-webhook-service-cert, was never created. At 20:35:03 UTC, the CAPI controller pod still reported: This left the controller in ContainerCreating for over 30 minutes, with no webhook endpoints. |
|
Thank you for the detailed report. I will leave this PR closed, because the state you hit is not the one #9128 diagnoses, and backporting it would not have changed anything in your cluster. What you hit is #6331. The fix for that is #9224, which shipped in v1.21.3, with a second fix (#9116) that I propose we backport. Why #9128 does not apply#9128 only adds an Event and a log line when a CertificateRequest has a What happened in v1.21.2Sequence, with links to the v1.21.2 code
Fixes
If it happens again on v1.21.3, please attach the CertificateRequest YAML, the Events on the Certificate, and the full text of the two [Claude Fable 5.1] |
Pull Request Motivation
Manual cherry-pick of #9128 to release-1.21. Part of #9237.
Prow's
/cherry-pickcannot apply it because both changed files conflict on release-1.21. The conflicts are unrelated to this change:issuing_controller.go: the const block on master also hasreasonTemporaryCertificateFailed, which release-1.21 lacks. OnlyreasonStalledis added here.issuing_controller_test.go: the surrounding test cases on master come from fix(issuing): do not fail issuance for a request built from a replaced key #9116, which is not on release-1.21. Only the two test cases from fix(issuing): surface stalled CertificateRequest with failureTime but no Ready condition #9128 are added here.The resulting diff is the #9128 diff with one const alignment change.
go test ./pkg/controller/certificates/issuing/...andgo vetpass on the branch.Kind
/kind bug
Release Note
[Claude Fable 5.1]