Repository navigation
Conversation
…rever
ExternalDNS does not promise that an UpdateNew endpoint is already in the zone: its TXT
registry can emit an UpdateNew for an ownership record that is absent. This provider
fails such a change, and keeps failing it on every reconcile:
could not build record (&{UPDATE <prefix>a-foo.example.com 0 IN TXT ...}): not found
recordSet() already tolerates a NotFoundError from the lookup -- that is what
isNotFoundError is for, and why the branch does not abort on it -- but err is a named
return and is never cleared, so the tolerated not-found leaves the function anyway and
buildRecord turns it into the error above.
With that fixed, getRefID answers "" and no error for a record that is absent, and
submitChanges would call UpdateObject with an empty ref. So UPDATE now creates when there
is nothing to update, rebuilding the record in its create shape because that path sets the
View that Infoblox needs to find the parent zone and rejects on an update. DELETE of an
absent record becomes a no-op for the same reason: its desired state is already met.
recordSet also works on a copy of the endpoint now. Its TXT branch normalises Targets in
place with strconv.Unquote, which was harmless while it ran once per change; the upsert
calls it a second time, and without the copy a TXT whose value is itself a quoted string
would lose a layer.
Both tests fail before the change and pass after it.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0114JL1WD4H4QL29Svh8mg3Z
samudm98
requested review from
Buzzglo,
TebogoTS,
ampie,
k0da and
kuritka
as code owners
October 20, 2026 10:38
k0da
approved these changes
Oct 27, 2026
Collaborator
|
@samudm98 |
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.
Fixes #83.
An
UPDATEfor a record that is not in the zone fails withcould not build record: not found, and keeps failing on every reconcile. ExternalDNS does not promise that anUpdateNewendpoint already exists: its TXT registry can emit anUpdateNewfor an ownership record that is absent from the zone, so the condition is normal input, not an error. The issue has the full analysis.Changes
recordSet()no longer leaks a tolerated not-found. The five lookup branches already tolerateNotFoundError; they just never clearederr, which is a named return, so it escaped throughbuildRecordanyway.submitChangesupserts. With the above fixed,getRefIDanswers""and no error for an absent record, soUPDATEnow creates instead of callingUpdateObjectwith an empty ref. The record is rebuilt in its create shape, because that path sets theView— Infoblox needs it to find the parent zone and rejects it on an update.DELETEof an absent record is a no-op, rather thanDeleteObject(""). Its desired state is already met. This is needed to avoid a regression: before, such a delete failed earlier, atbuildRecord.recordSetworks on a copy of the endpoint. Its TXT branch normalisesTargetsin place withstrconv.Unquote, to match the API stripping the enclosing quotes of a value without whitespace. That was harmless while it ran once per change; the upsert calls it a second time, and without the copy a TXT whose value is itself a quoted string loses a layer —"\"token\""would be stored astokenwhere a plain create stores"token".Tests
Two, both failing before the change and passing after:
TestInfobloxApplyChangesUpsertsMissingRecord— a zone holding the A record but not its TXT, with a matchedUpdateOld/UpdateNewpair soCountDiffkeeps the action anUPDATE. Asserts the TXT is created and the A is still updated.TestInfobloxApplyChangesUpsertKeepsQuotedTXTIntact— asserts parity rather than a literal: an upsert must store exactly what a create of the same endpoint stores.mockIBConnectorgains one opt-in field,txtNotFound, so a TXT lookup matching nothing answers with theNotFoundErrorthe real client returns instead of an empty result. It is off by default and no existing test changes.