Locator address overriding
This adds the ability to specify a custom locator address for each endpoint defined in the config. This is useful in niche scenarios where the interface address generated by Zenoh for use in the advertised locator is inconsistent with an external NAT IP address.
For example, one could define an endpoint like so:
{
"endpoints": ["tls/0.0.0.0:1234#loc_addr=192.168.0.200"]
}
This can be combined with other connection parameters like iface by separating options with semicolons, like #loc_addr=192.168.0.200;iface=eth0.
Feel free to suggest any stylistic changes that you prefer (variable names, adding/removing debug printouts, etc.).
PR missing one of the required labels: {'breaking-change', 'enhancement', 'new feature', 'dependencies', 'internal', 'bug', 'documentation'}
Hi @mmusselman-crl, to accept contributions we need contributors to have signed the Eclipse ECA. The instructions can be found here: https://api.eclipse.org/git/eca/status/gh/eclipse-zenoh/zenoh/2039. Thanks!
I've signed the ECA now.
@mmusselman-crl looks like some lint checks are failing. Could you address those, please?
Codecov Report
Attention: Patch coverage is 85.71429% with 1 line in your changes missing coverage. Please review.
Project coverage is 71.00%. Comparing base (
47fa6e5) to head (e79c314). Report is 19 commits behind head on main.
| Files with missing lines | Patch % | Lines |
|---|---|---|
| io/zenoh-link-commons/src/listener.rs | 85.71% | 1 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## main #2039 +/- ##
==========================================
+ Coverage 70.89% 71.00% +0.10%
==========================================
Files 367 367
Lines 62240 62246 +6
==========================================
+ Hits 44127 44196 +69
+ Misses 18113 18050 -63
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
I've updated the PR to include a test that should hopefully satisfy the code coverage check. I was able to get it to pass locally, but I'm having trouble getting some other tests to pass. Those tests seem to be mostly unrelated to my PR, though, so it might just be due to differences between my computer and the CI environment.
I also added a couple of lines to the .json5 files, since they seem to be the only places where endpoint arguments like #iface are documented.
@mmusselman-crl you can reproduce format check failure locally with the same command as in CI: https://github.com/eclipse-zenoh/zenoh/actions/runs/16425821734/job/46451431435?pr=2039
rustfmt --check --config "unstable_features=true,imports_granularity=Crate,group_imports=StdExternalCrate,skip_children=true" $(git ls-files '*.rs')
and even fix it in place by removing --check
I've fixed the format check failures; please let me know if there is anything else I need to fix.