Skip to content
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

Backport of NET-7644/NET-7634 - Implement query lookup for tagged addresses on nodes and services including WAN translation. into release/1.18.x #1023

Open
3 tasks done
dhiaayachi opened this issue Sep 27, 2024 · 0 comments

Comments

@dhiaayachi
Copy link
Owner

Backport

This PR is auto-generated from hashicorp#20583 to be assessed for backporting due to the inclusion of the label backport/1.18.

🚨

Warning automatic cherry-pick of commits failed. If the first commit failed,
you will see a blank no-op commit below. If at least one commit succeeded, you
will see the cherry-picked commits up to, not including, the commit where
the merge conflict occurred.

The person who merged in the original PR is:
@jmurret
This person should manually cherry-pick the original PR into a new backport PR,
and close this one when the manual backport PR is merged in.

merge conflict error: POST https://api.github.com/repos/hashicorp/consul/merges: 409 Merge conflict []

The below text is copied from the body of the original PR.


Description

Fixes tests:

  • TestDNS_Lookup_TaggedIPAddresses (passing). part of NET-7644.
  • TestDNS_ServiceLookup_WanTranslation (not passing). part of NET-7634.

Notes

  • this logic requires addtional data from the database in the TaggedAddresses collection on nodes and services, as well as it also requires whether you are asking for IPV6, IPV4 or ANY,
  • since it requires data from the database, there needs to be a change to DiscoveryResult.
    • Right now it is just TaggedAddresses on the Discovery Result level.
    • Also, the Tagged Address on the service has address and PortNumber, so I hacked around with moving PortName and PortNumber to the Location struct and then making Tagged Addresses a map[string]*Location on the discovery result.
    • This is still a WIP and it looks like both Node and Service will need tagged addresses, so we will consider moving TaggedAddresses into DiscoveryResult.Node and DiscoveryResult.Service.
  • On the translation end of things, rather than copying all of the address translation code, I opted to ust inject the function from the agent as we did with various rpc functions.
    • Since the return type is in the agent package, I had to move the TranslateAccept enum in internal/dnsutil/dns.go to avoid import cycles.

Testing & Reproduction steps

Links

PR Checklist

  • updated test coverage
  • [ ] external facing docs updated
  • appropriate backport labels added
  • not a security concern

Overview of commits
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant