Skip to content

fix(e2e): randomise CommonName in otherName SAN conformance test - #9057

Merged
cert-manager-prow[bot] merged 1 commit into
cert-manager:masterfrom
wallrj-cyberark:fix-tpp-e2e-hardcoded-common-name
Jul 22, 2026
Merged

cert-manager-prow[bot] merged 1 commit into
cert-manager:masterfrom
wallrj-cyberark:fix-tpp-e2e-hardcoded-common-name

Conversation

@wallrj-cyberark

Copy link
Copy Markdown
Member

Motivation

The issuers-venafi TPP periodic e2e job has been failing on master, release-1.21, and release-1.20 on every recent run (see testgrid), with:

vcert error: your data contains problems: request doesn't match certificate: unmatched key modulus

Root cause

The conformance test case "should issue a certificate with a couple valid otherName SAN values set as well as an emailAddress" sets a hardcoded, non-randomised CommonName (someCN), unlike every other CN-setting case in this file, which appends rand.String(10).

vcert's TPP connector unconditionally sets Reenable: true on every certificate request, and computes the TPP CertificateDN from the CommonName when no FriendlyName is explicitly set (cert-manager derives FriendlyName from the CN). With a fixed CN, every single run of this test, on every branch, resolves to the same TPP certificate object rather than an independent one.

master's and release-1.21's TPP periodics run two minutes apart every two hours (16 00-23/02 * * * vs 18 00-23/02 * * *), so two runs can have competing in-flight requests for that one shared object. One run's retrieval can pick up a certificate that TPP just issued for the other run's key, and vcert's client-side CheckCertificate correctly rejects the mismatch — unmatched key modulus. cert-manager's Venafi issuer treats this as a hard failure rather than pending, so a fresh CertificateRequest (fresh key) is created and collides again, producing the repeating failure loop visible in the job logs until the test times out.

This is the same underlying mechanism as #5041.

Change

Randomise the CommonName the same way the sibling test case above it already does. The comparison in this test (HaveSameSANsAs) only checks the SAN extension bytes, not the Subject CommonName, so this does not affect what the test verifies.

Verification

  • go build ./... in test/e2e (has its own go.mod).
  • Requesting a manual run of /test pull-cert-manager-master-e2e-v1-36-issuers-venafi-tpp on this PR to confirm the fix against the live shared TPP zone before merge.

Release Note

NONE

The "otherName SAN values / emailAddress" conformance test case used a
hardcoded CommonName ("someCN") instead of a randomised one like every
other CN-setting case in this file.

vcert's TPP connector always sets Reenable=true on certificate
requests, and derives the TPP CertificateDN from the CommonName when
no FriendlyName is set. With a fixed CN, every run of this test across
every branch resolves to the exact same TPP certificate object,
causing concurrent periodic runs (master and release-1.21 run the TPP
e2e suite two minutes apart, every two hours) to collide: one run's
retrieval can pick up a certificate freshly issued for a different
run's key, and vcert's client-side CheckCertificate correctly rejects
it with "unmatched key modulus". This is the same mechanism as
cert-manager#5041.

Signed-off-by: Richard Wall <[email protected]>
@cert-manager-prow cert-manager-prow Bot added release-note-none Denotes a PR that doesn't merit a release note. dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. labels Jul 21, 2026
@wallrj-cyberark

Copy link
Copy Markdown
Member Author

/test pull-cert-manager-master-e2e-v1-36-issuers-venafi-tpp

@cert-manager-prow cert-manager-prow Bot added needs-kind Indicates a PR lacks a `kind/foo` label and requires one. area/testing Issues relating to testing size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jul 21, 2026
@wallrj-cyberark

Copy link
Copy Markdown
Member Author

/kind flake

@cert-manager-prow cert-manager-prow Bot added kind/flake Categorizes issue or PR as related to a flaky test. and removed needs-kind Indicates a PR lacks a `kind/foo` label and requires one. labels Jul 21, 2026
@wallrj-cyberark

Copy link
Copy Markdown
Member Author

Re-triggering in isolation: the previous manual run overlapped with the master and release-1.21 periodics (started 11:55 UTC, ran ~59 min, periodics fired at 12:16/12:18), putting up to 5 concurrent TPP suites against the shared zone at once. No unmatched key modulus occurred in that run, but nearly every spec hit its per-test timeout under that load, so it is not a clean read on the fix. Retrying alone.

/test pull-cert-manager-master-e2e-v1-36-issuers-venafi-tpp

@wallrj-cyberark

Copy link
Copy Markdown
Member Author

/retest

@wallrj-cyberark

Copy link
Copy Markdown
Member Author

Re-triggering after resolving an issue with the shared TPP test infrastructure. This should be a clean run.

/test pull-cert-manager-master-e2e-v1-36-issuers-venafi-tpp

@wallrj-cyberark
wallrj-cyberark requested a review from inteon July 22, 2026 11:09
@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 Jul 22, 2026
@inteon

inteon commented Jul 22, 2026

Copy link
Copy Markdown
Member

/lgtm
/approve

@cert-manager-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: inteon

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 lgtm Indicates that a PR is ready to be merged. label Jul 22, 2026
@cert-manager-prow
cert-manager-prow Bot merged commit 6c3b192 into cert-manager:master Jul 22, 2026
7 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. area/testing Issues relating to testing dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. kind/flake Categorizes issue or PR as related to a flaky test. lgtm Indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants