-
Notifications
You must be signed in to change notification settings - Fork 624
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
Host-agent DNS forwarder improvements (fixes #770) #319
Conversation
Once you are done with this PR please squash commits into either a single commit, or two commits: one for adding the TCP port, and one for adding additional |
1f89a17
to
d0b1a39
Compare
Is this still a draft? |
I think it is waiting for feedback from me. Will try to do it today. |
Most of the discussion is actually happening in rancher-sandbox/rancher-desktop#770 |
3fca84b
to
08ff7c7
Compare
08ff7c7
to
0cd249c
Compare
@dee-kryvenko Sorry, I can't finish the review right now. I want to understand the logic behind recursion, and if returning I'll also want to take a look into adding support for |
0cd249c
to
dbce97a
Compare
@jandubois added the SRV too. As to the recursion - so the client can request server to do a recursion for it (
This is one of the things I mentioned in rancher-sandbox/rancher-desktop#770 - I don't know the RFC and I don't know if it's a correct behavior, I just observed other public recursive resolvers are doing that. |
Well, and here goes the first - I was wrong. Apparently recursion only meant for the zone delegation stuff and not the CNAME. Here's what Google does:
So it always gives both CNAME and A. |
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.
I'm done with this round of reviews now.
The important changes are using the canonical name instead of the query name when looking up A
and AAAA
entries for a CNAME
record, and dropping the erroneous CNAME
for SRV
queries.
381084d
to
7fcaa8b
Compare
@AkihiroSuda - just a feedback, |
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.
Almost there, but the hdr.Name = lookupName
change is still required for A
and AAAA
answers.
With this final change I would be willing to merge: --- pkg/hostagent/dns.go
+++ pkg/hostagent/dns.go
@@ -97,12 +97,14 @@ func (h *Handler) handleQuery(w dns.ResponseWriter, req *dns.Msg) {
ipv6 := ip.To4() == nil
if q.Qtype == dns.TypeA && !ipv6 {
hdr.Rrtype = dns.TypeA
+ hdr.Name = lookupName
a = &dns.A{
Hdr: hdr,
A: ip.To4(),
}
} else if q.Qtype == dns.TypeAAAA && ipv6 {
hdr.Rrtype = dns.TypeAAAA
+ hdr.Name = lookupName
a = &dns.AAAA{
Hdr: hdr,
AAAA: ip.To16(), |
Are you familiar with Github also shows you the old and new SHA1 of your branch for each forced push, so that also allows you to switch back to any older commit. And the string "force-pushed" in the Github UI is a hyperlink that lets you see the difference between the previous and the new branch. So there are plenty of ways to recover your older commits and branches. After 90 days the reflog no longer holds a reference to them, so a garbage collection run might remove them. But chances are high that if you haven't missed them in 90 days, you will never need them again. |
7fcaa8b
to
dbc04dc
Compare
I am, but I don't find working with detached heads even remotely comparable, not to mention that many of us have more than one workspation and it brings additional complexity when you need partial rollback or something. I find it useful to have contextual history in the PR available handy as sometimes it helps the reviewer (or even a user) to easily find and browse what was done and why it wasn't included in the final version. |
I mean |
I believe the idea is that the PR author is the one to decide how to structure commits. We don't want each PR to be a single commit; you should still separate unrelated changes into their own commits, with a focused commit message (when possible). But anything that is just part of development history, like any changes that are being reverted in later commits, should not become part of permanent history. There is no requirement to always squash your commits right away, just during the final code review before they are being merged. |
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.
LGTM
I must have misunderstood your earlier request. Here is a good use case - GitHub feature that allowed you to propose a change that I could accept into this PR with a single click. Ideally this should be all I need to do, so we can streamline the process as much as possible towards contributors encouragement... Now, do I have to still squash it before the merge or maintainer will do it at merge using https://docs.github.com/en/github/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/about-pull-request-merges#squash-and-merge-your-pull-request-commits? |
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.
And just as I approve it, the DCO bot complains about the new commit not being signed.
It happens all the time when people commit using the web ui...
Please fetch, squash, make sure it is signed and push once more.
There is no signature on the latest commit:
|
There is a GPG signature:
I thought it's "mine" (one GitHub auto generated for my account), but turns out it is GitHub's one that they use for everyone making changes in the UI. That's what gives that commit a I will re-sign with mine, but I think what DCO is complaining about is a sign-off and not a signature (a text in the commit message). I'm slightly confused why this is important and not the actual signature, as the signature is what gives it authenticity and not the text, right? |
- Listen for TCP traffic - Add AAAA, CNAME, NS, MX, TXT and SRV forwarding - Fix `iptables` forward rules so hostagent is accessible from containers Co-authored-by: Jan Dubois <jan@jandubois.com> Signed-off-by: Dmytro Kryvenko <llibicpep@gmail.com>
19ebfb6
to
89a7a4e
Compare
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.
LGTM
Yes, the DCO bot cares only about the sign-off. I'm somewhat confused how this holds legal significance, given how easily it can be spoofed, but it is a requirement from all the big foundations nowadays that all contributions have to come with a DCO "declaration". It is certainly a barrier to contribution, but compared to the old days, when you had to send a CLA by snail-mail and include a copyright assignment, this is much simpler and less intrusive. So to keep the option open to eventually transfer Lima to e.g. the CNCF or the Linux Foundation, or whatever a good home would be, we need to insist on getting DCO sign-off on every commit. And I think this would also prevent us from "squash during merge" because we could not attach a sign-off to the squashed commit; only the original developer can do that. |
Thank you for your work, and your patience going through the whole process! |
Ah, good point. Well... classics... legal vs progress :) Thanks to you too - it was fun and I've learned a few things about DNS. |
Previous issues:
Fixes: rancher-sandbox/rancher-desktop#770
iptables
forward rules so hostagent is accessible from containers