Repository navigation
Conversation
39 of 41 tasks
…-manager#9101) * fix(digitalocean): paginate TXT record lookups in findTxtRecord The DigitalOcean DNS-01 solver listed a zone's TXT records with nil godo.ListOptions, so the DigitalOcean API silently capped the response at its default page size of 20 and only the first page was ever inspected. Challenge records are always the newest (highest-ID) records in a zone, so any zone holding more than ~20 TXT records would never match a challenge record: CleanUp deleted nothing and Present's duplicate-record check never found an existing record, with no error surfaced anywhere. findTxtRecord now pages through the full result set using an explicit per_page and a loop over Response.Links, so it always inspects every TXT record in the zone regardless of size. It also now takes the zone name as a parameter instead of re-resolving it via DNS internally (Present/CleanUp already know it), which avoids a redundant lookup and makes the function directly unit-testable against a mocked DigitalOcean API. Fixes cert-manager#9099 Signed-off-by: Abmun <[email protected]> * fixup: address review feedback from @wallrj - CleanUp now only deletes the TXT record whose value matches the challenge being cleaned up, instead of every record sharing its name. With pagination now surfacing records beyond page 1, the previous behaviour would delete a sibling challenge's record (e.g. concurrent example.com + *.example.com orders) out from under it. - findTxtRecord now uses godo's server-side RecordsByTypeAndName filter instead of listing every TXT record in the zone and matching client side. This cuts requests against large zones down to ~1 per lookup and closes a race where an unsnapshotted, unfiltered paginated listing could skip a record if another challenge concurrently created/deleted records in the same zone while the loop was walking pages. - Removed the resp == nil dead branch in the pagination loop (godo guarantees resp is non-nil whenever err is nil, so this arm could only ever silently truncate results were it ever reachable) and replaced reliance on Links.CurrentPage() (which pins at 2 forever if a page ever has next but no prev) with a simple incrementing page counter. - Test fake DigitalOcean server now enforces the type+name filter server-side rather than returning every record for the client to filter, so the tests actually exercise production code paths. Replaced fmt.Sscanf-based page parsing with strconv.Atoi to match how godo itself parses page numbers. - Added TestCleanUpOnlyDeletesMatchingValue and TestFindTxtRecordFiltersServerSide regression tests; adapted the pagination test to the server-side-filtered scenario (many records sharing one name) since a name filter makes cross-page misses on unrelated records impossible by construction. Signed-off-by: Abmun <[email protected]> * fixup: satisfy golangci-lint (intrange, unparam) CI flagged three issues in the new test helpers: - pkg/issuer/acme/dns/digitalocean/digitalocean_test.go:354: for loop can use Go 1.22+ integer range (intrange). Switched 'for i := 0; i < 25; i++' to 'for i := range 25'. - newFakeDOServer's domain parameter and newTestProvider's zone parameter always received the same value at every call site (unparam), since every test in this file uses the same fake zone. Replaced both parameters with shared testDomain/testZone constants and dropped fakeDORecord.fullName's domain parameter for the same reason. Signed-off-by: Abmun <[email protected]> --------- Signed-off-by: Abmun <[email protected]> (cherry picked from commit 578dc72) Signed-off-by: Richard Wall <[email protected]> Co-Authored-By: Claude Fable 5 <[email protected]>
wallrj
force-pushed
the
cherry-pick-9101-release-1.21
branch
from
September 1, 2026 13:13
d2fc1a6 to
86749ca
Compare
Member
Author
|
Fixed the with claude fable-5 |
Contributor
|
[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 |
3 tasks done
Member
Author
|
/hold |
This was referenced Oct 23, 2026
18 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Manual cherry-pick of #9101 (fixes #9099) for v1.21.2; the automated cherry-pick failed with conflicts.
The production code change (
digitalocean.go) is picked unchanged. The new tests needed adapting, because they were written against the DNS provider options/resolver API that only exists on master:newTestProviderusesNewDNSProviderCredentials, the constructor onrelease-1.21, instead ofNewDNSProviderFromOptions.TestCleanUpOnlyDeletesMatchingValueand the fake resolver it needs:release-1.21has no injectable resolver, so exercisingCleanUpwould perform live DNS lookups viautil.FindZoneByFqdn. The value-matching guard that test covers is already present onrelease-1.21. The threefindTxtRecordtests (server-side filter, pagination, no-match) are picked unchanged —findTxtRecordtakes the zone directly and needs no DNS resolution.go vetandgo test ./pkg/issuer/acme/dns/digitalocean/...pass locally./assign wallrj
/kind bug
with claude fable-5