fix: surface specific PowerDNS 422 detail in DNSRecordSet status#52
Open
ecv wants to merge 1 commit into
Open
Conversation
FriendlyMessage collapsed every unrecognized 422 into a generic "rejected as invalid" message, dropping the pdns `error` field. The real rejection reason then only existed in operator pod logs, leaving `kubectl get dnsrecordset -o yaml` with nothing actionable (surfaced while diagnosing dns-operator#51). Append the specific pdns detail to the generic 422 fallback so the reason reaches the CR status. Known actionable patterns and the empty-body case are unchanged. Refs: #51 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This was referenced Jul 5, 2026
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.
What
When PowerDNS rejects a PATCH with a 422 whose
errorfield doesn't match one of the curated patterns,FriendlyMessagecollapsed it into a generic"The DNS record was rejected as invalid. Check the record type and value."— dropping the specific pdns reason. The detail survived only in the operator pod logs (logger.Error(pdnsErr, "pdns apply failed")), sokubectl get dnsrecordset -o yamlshowed nothing actionable.This appends the specific pdns detail to the generic 422 fallback:
Why
Surfaced while diagnosing #51 (fleet-wide prod 422s on
PATCH /zones). The whole investigation stalled on "we can't see the rejection reason" — but the reason was being thrown away at the status layer, not unavailable. With this change, future pdns validation regressions are diagnosable from the CR status without pod-log access.Scope
Invalid character,Not in zone,Conflicts with pre-existing RRset, CNAME/ALIAS conflicts) are unchanged.Test
internal/pdns/errors_test.go— the "unknown 422 body" case now asserts the detail is surfaced.go test ./internal/pdns/ -run TestFriendlyMessagepasses. (The package's Docker/testcontainers integration test is unrelated and not run here.)Refs #51
🤖 Generated with Claude Code