Skip to content

Conversation

@javorszky
Copy link
Contributor

Proposed changes

Closes #8708

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that all unit tests pass after adding my changes
  • I have updated necessary documentation
  • I have rebased my branch onto main
  • I will ensure my PR is targeting the main branch and pulling from my branch from my own fork

@javorszky javorszky requested a review from a team as a code owner January 13, 2026 17:20
Copilot AI review requested due to automatic review settings January 13, 2026 17:20
@github-actions github-actions bot added bug An issue reporting a potential bug go Pull requests that update Go code labels Jan 13, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the getValidTargets function to return a list of DNSTarget objects instead of a simple string slice and a separate record type. The new structure combines the target address with its record type (A, AAAA, or CNAME), allowing the system to handle multiple record types for a single DNS endpoint.

Changes:

  • Modified getValidTargets to return extdnsapi.Targets (slice of DNSTarget structs) instead of a string slice and separate record type
  • Updated buildDNSEndpoint to group targets by record type and create separate endpoints for each type
  • Introduced new DNSTarget type with Type and Address fields to replace the simple string-based Targets type

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pkg/apis/externaldns/v1/types.go Introduced DNSTarget struct and changed Targets type from []string to []DNSTarget
pkg/apis/externaldns/v1/zz_generated.deepcopy.go Added auto-generated deepcopy methods for new DNSTarget type
pkg/apis/externaldns/validation/externaldns.go Updated validateTargets and isUnique to accept []string instead of v1.Targets
pkg/apis/externaldns/validation/externaldns_test.go Updated test cases to use []string instead of v1.Targets for target values
internal/externaldns/sync.go Refactored getValidTargets to return typed targets and updated buildDNSEndpoint to collate targets by type
internal/externaldns/sync_test.go Updated tests to expect new DNSTarget structure and removed record type assertions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov
Copy link

codecov bot commented Jan 13, 2026

Codecov Report

❌ Patch coverage is 45.94595% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 53.88%. Comparing base (8126541) to head (110e230).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
internal/externaldns/sync.go 42.85% 20 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8869      +/-   ##
==========================================
- Coverage   53.93%   53.88%   -0.05%     
==========================================
  Files          91       91              
  Lines       18627    18628       +1     
==========================================
- Hits        10046    10038       -8     
- Misses       8049     8059      +10     
+ Partials      532      531       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug An issue reporting a potential bug go Pull requests that update Go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: DNSEndpoint recordType is incorrect for dual-stack services

2 participants