-
Notifications
You must be signed in to change notification settings - Fork 38.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
coredns: support IPv6 record set #44403
Conversation
Hi @pmichali. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
@k8s-bot ok to test |
@@ -75,6 +75,8 @@ func (rrsets ResourceRecordSets) Get(name string) (dnsprovider.ResourceRecordSet | |||
rrset.rrsType = rrstype.CNAME | |||
case ip.To4() != nil: | |||
rrset.rrsType = rrstype.A | |||
default: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we not want to test ip.To6 here, instead of defaulting to ipv6?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review comment. I was thinking it wasn't necessary, because it looks like ParseIP() will either eval the string to an IP (v4 or v6) or return nil. As a result, I figured that there are cases for nil and IPv4, so the value would have to be Ipv6, if those two cases didn't match. Is that acceptable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I:
- Leave it as-is
- Add a comment indicating the default is for IPv6
- Add a case with test for To6(), and then have default case with comment indicating it should never occur?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will take a guess at option #2, adding a comment, so that this can move forward.
18a9cc7
to
73a0196
Compare
Any feedback on the latest change set? |
Change is ready for review - please. |
Reviewed 4 of 5 files at r1, 1 of 1 files at r2. federation/pkg/dnsprovider/providers/coredns/coredns_test.go, line 265 at r2 (raw file):
This comment may not be completely true after this PR #44626. In that PR @madhusudancs has changed Get() to return multiple rrsets for a name with different types. PTAL and update. federation/pkg/dnsprovider/tests/commontests.go, line 92 at r2 (raw file):
Comments from Reviewable |
Review status: all files reviewed at latest revision, 3 unresolved discussions. federation/pkg/dnsprovider/providers/coredns/coredns_test.go, line 265 at r2 (raw file): Previously, shashidharatd (Shashidhara T D) wrote…
Thanks for the update about the other commit. I'll rebase to pick up the changes and update this commit. federation/pkg/dnsprovider/tests/commontests.go, line 92 at r2 (raw file): Previously, shashidharatd (Shashidhara T D) wrote…
It's been a few weeks since I wrote this, and the PR #44626 may change things, so I'll revisit it. Originally, I wanted to use the CommonTestResourceRecordSetsDifferentTypes test, which had IPv4 and IPv6 IPs for the same name, but coredns didn't support that, so I created this test, using different names. Comments from Reviewable |
Review status: all files reviewed at latest revision, 3 unresolved discussions. federation/pkg/dnsprovider/providers/coredns/rrsets.go, line 78 at r1 (raw file): Previously, pmichali (Paul Michali) wrote…
Done. Comments from Reviewable |
Review status: all files reviewed at latest revision, 3 unresolved discussions. federation/pkg/dnsprovider/providers/coredns/coredns_test.go, line 265 at r2 (raw file): Previously, pmichali (Paul Michali) wrote…
Pulling this test method, as existing CommonTestResourceRecordSetsDifferentTypes will work now that Get() has been changed. federation/pkg/dnsprovider/tests/commontests.go, line 92 at r2 (raw file): Previously, pmichali (Paul Michali) wrote…
Yes, this is no longer needed, as we can use CommonTestResourceRecordSetsDifferentTypes now, because Get() now returns a list, instead of single rrset. Updating. Comments from Reviewable |
Review status: all files reviewed at latest revision, 3 unresolved discussions. federation/pkg/dnsprovider/providers/coredns/coredns_test.go, line 265 at r2 (raw file): Previously, pmichali (Paul Michali) wrote…
Done. federation/pkg/dnsprovider/tests/commontests.go, line 92 at r2 (raw file): Previously, pmichali (Paul Michali) wrote…
Done. Comments from Reviewable |
Pushed up a new commit, PTAL |
/lgtm Reviewed 3 of 3 files at r3. Comments from Reviewable |
@madhusudancs, PTAL and approve this PR. Thanks. |
@shashidharatd thank you for reviewing! |
Reviewed 2 of 5 files at r1, 3 of 3 files at r3. federation/pkg/dnsprovider/providers/coredns/rrsets.go, line 78 at r1 (raw file): Previously, pmichali (Paul Michali) wrote…
I would have preferred 3 for clarity and/or readability, but this is fine for now. federation/pkg/dnsprovider/tests/commontests.go, line 34 at r3 (raw file):
This logic is clever and definitely fewer lines of code, but IMO, it obscures what is really happening. It makes comprehending this code difficult. Why is whatever is returned by I would really urge to revert back to the previous code. Even though, it is verbose, less clever, it is clear. Comments from Reviewable |
Review status: all files reviewed at latest revision, 2 unresolved discussions. federation/pkg/dnsprovider/providers/coredns/rrsets.go, line 78 at r1 (raw file): Previously, madhusudancs (Madhusudan.C.S) wrote…
Since I'm changing, I'll modify this. federation/pkg/dnsprovider/tests/commontests.go, line 34 at r3 (raw file): Previously, madhusudancs (Madhusudan.C.S) wrote…
Sure. Will change this back and post an update. Comments from Reviewable |
Added support for AAAA record for coredns and included unit test. Fixed function names in comments for Google and AWS tests to match actual test name in this area.
PTAL I pushed a new version of the changes to revert the changes to addRrsetOrFail(), change the switch statement, and added UT code to check the Zone() method, which was not covered. Rebased this morning (hopefully that is recent enough). |
PTAL as I pushed up a new version that modifies the switch statement, reverts the addRrsetOrFail() changes to not return a method to clean up. Left the logging for success, to reduce some duplication, and added a bit of code to cover the Zone() method for coverage. Review status: 2 of 5 files reviewed at latest revision, 2 unresolved discussions. Comments from Reviewable |
Thanks for making these changes! /lgtm Reviewed 3 of 3 files at r4. Comments from Reviewable |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: madhusudancs, pmichali, shashidharatd
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
Automatic merge from submit-queue (batch tested with PRs 45860, 45119, 44525, 45625, 44403) |
@madhusudancs @shashidharatd Thanks for the prompt review and approval! |
Added support for AAAA record for coredns and included unit test.
Refactored common test code to reduce duplication from added test and
existing tests.
Fixed function names in comments for Google and AWS tests to match
actual test name in this area.
What this PR does / why we need it:
Adding IPv6 support to kubernetes, once piece at a time. :)
Which issue this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close that issue when PR gets merged): fixes #44351Special notes for your reviewer:
In addition to the change and unit test method, I did some minor refactoring (since the UT was a near clone of an existing test). Fixed typos in related test methods' comment lines. Please let me know if this is OK (I was thinking it was a small change, but don't know the protocol here), or if I need to break it into multiple commits.
Release note: