-
Notifications
You must be signed in to change notification settings - Fork 43
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
Implement plugin support for resolving domain names #266
base: main
Are you sure you want to change the base?
Implement plugin support for resolving domain names #266
Conversation
Should've run rustfmt before creating this PR 🤦🏻, completely forgot about it |
Thank you for your PR! I will take a look in the next two days. And for your question:
It is required ;-). We don't have 100% code coverage in tests, but we want to make sure every new feature or bugfix is covered by some test. |
Yeah, thanks for replying. I also noticed some bad pieces of code I made, but only after sending this PR, will fix them later today (GMT+2/EET). An example is how the plugins-provided serviceinfos are discovered - I am doing lots of copying there, will fix that. (I am too used to by-reference variables like in Java, did not notice that while implementing) |
Pushed some improvements, added a test for this new feature. Should be in reviewable state now. |
Oh, LazyCell is not yet available in this Rust version. Will fix. |
Could you please elaborate the use case? (No need to give any private info, but please provide as much details as possible). I am trying to understand if such a plugin infra is what we'd like to support the user case you have. |
Well, the most exact reason is that tracking LXC-specific events to track the running containers is not as easy (more like, I haven't heard of that) as just doing I mean, I can do |
Will each LXC container run a mDNS server to publish a service? What info would you "reconfigure" mdns-sd? IP address, or something else? |
LXC containers can have dedicated IP addresses on interfaces when this is explicitly allowed. |
So there are two approaches now - one is hosting mdns inside these containers, and the other one is using a host-machine-side daemon for that |
If I understand, the requirement here is: as LXC container IP address might change overtime, you want to be able to resolve domain names to the current IP address, not necessary the IP address passed in (If I mis-understood, please correct me) For this, we support |
Hmmm. What if a container is added or removed in runtime? Yes, in these cases I can theoretically do some minimal diffing, although I am not sure which approach is better - plugin-based approach allows going without diffing, just by listing all available services, while diffing requires implementing more complex logic on the consumer side. |
What is the main concern? Suppose you have mdns-sd daemon
Did you mean the main issue is: how does a client deal with a service running in a LXC container come and go when the container comes and goes? Is this similar with the issue #54 , i.e. a better detection of service removed? (note that currently |
Just a follow up, issue #54 is resolved now with a new |
Just a sketch PR to add plugin support into the library.
Just as a note, I am not a Rust developer - more like Java and Node.js -, so codestyle inaccuracies might be there - feel free to tell me about them.
By the way, what is the current state of the testing infra, is that required, recommended, or done on the "best-effort" principle here?
This PR is inspired by a feature I am trying to build in a tiny pet project I have - mDNS publisher for LXC containers which are running on my home lab.