Repository navigation
fix(e2e): randomise CommonName in otherName SAN conformance test - #9057
Conversation
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]>
|
/test pull-cert-manager-master-e2e-v1-36-issuers-venafi-tpp |
|
/kind flake |
|
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 /test pull-cert-manager-master-e2e-v1-36-issuers-venafi-tpp |
|
/retest |
|
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 |
|
/lgtm |
|
[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 DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Motivation
The
issuers-venafiTPP periodic e2e job has been failing onmaster,release-1.21, andrelease-1.20on every recent run (see testgrid), with: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 appendsrand.String(10).vcert's TPP connector unconditionally sets
Reenable: trueon every certificate request, and computes the TPPCertificateDNfrom 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 andrelease-1.21's TPP periodics run two minutes apart every two hours (16 00-23/02 * * *vs18 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-sideCheckCertificatecorrectly rejects the mismatch —unmatched key modulus. cert-manager's Venafi issuer treats this as a hard failure rather than pending, so a freshCertificateRequest(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 ./...intest/e2e(has its own go.mod)./test pull-cert-manager-master-e2e-v1-36-issuers-venafi-tppon this PR to confirm the fix against the live shared TPP zone before merge.Release Note