Skip to content

[release-1.21] Do not fail issuance for a request built from a replaced key - #9554

Merged
cert-manager-prow[bot] merged 1 commit into
cert-manager:release-1.21from
wallrj:cherry-pick-9116-release-1.21
Nov 23, 2026
Merged

cert-manager-prow[bot] merged 1 commit into
cert-manager:release-1.21from
wallrj:cherry-pick-9116-release-1.21

Conversation

@wallrj

@wallrj wallrj commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

Pull Request Motivation

Manual cherry-pick of #9116 to release-1.21, for v1.21.4.

A user has now hit #6331 on v1.21.2 with the in-tree SelfSigned issuer: #9324 (comment). Their webhook was down for the whole one hour failed-issuance backoff because a CertificateRequest signed with a replaced key was counted as a failed issuance. The analysis is in my reply there: #9324 (comment).

#9116 moves the key-mismatch check in the issuing controller above the Denied, InvalidRequest and Failed branches, so a stale request is left for the requestmanager to delete and rebuild instead of starting a backoff.

Prow's /cherry-pick cannot apply it because the test file conflicts. The conflict is unrelated to this change: the surrounding test case on release-1.21 comes from #9238 (the backport of #9118), which master has in a different place. The production file applies cleanly.

The resulting diff is the #9116 diff with two adjustments to the test file:

Verification on this branch
  • go test -race ./pkg/controller/certificates/issuing/ passes.
  • Reverting only issuing_controller.go fails exactly the two new test cases, as it does on master.

Kind

/kind bug

Release Note

Fixed an issue where rotating a Certificate's next private key while a CertificateRequest was in flight could mark the issuance as failed and delay it by a backoff, instead of waiting for the request to be rebuilt against the new key.

[Claude Fable 5.1]

Manual cherry-pick of cert-manager#9116 to release-1.21.

The two new test cases use nextPrivateKeySecretMeta, as master does since
cert-manager#9224, because cert-manager#9368 is already on this branch and the issuing controller
ignores a next private key Secret that the Certificate does not own.

(cherry picked from commit fadd523)

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Signed-off-by: Richard Wall <[email protected]>
@cert-manager-prow cert-manager-prow Bot added kind/bug Categorizes issue or PR as related to a bug. release-note Denotes a PR that will be considered when it comes time to generate release notes. dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 4, 2026
@wallrj
wallrj requested a review from lunarwhite November 22, 2026 07:18
@lunarwhite

Copy link
Copy Markdown
Member

/lgtm

@cert-manager-prow cert-manager-prow Bot added the lgtm Indicates that a PR is ready to be merged. label Nov 23, 2026
@wallrj

wallrj commented Nov 23, 2026

Copy link
Copy Markdown
Member Author

/approve

@cert-manager-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: wallrj

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@cert-manager-prow cert-manager-prow Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 23, 2026
@cert-manager-prow
cert-manager-prow Bot merged commit 87a67c6 into cert-manager:release-1.21 Nov 23, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants