salt
salt copied to clipboard
Extend auto discovery implementation
What does this PR do?
The primary intent of this PR is to extend the auto-discovery mechanism to support configuring the interface on which the Salt Service Discovery Protocol server and client should listen. The current implementation has a defect when used in an environment with multiple network interfaces, which can cause the Salt Master to repond with the incorrect master interface IP, respond from the wrong interface, or both. Additionally, the broadcast datagrams from the Salt Minion can be sent on multiple networks, regardless of the user's intent. With this PR, you can configure which interface IP both the server and client.
In the process of adapting the code to support configuring the interface IP, I refactored the module as whole. Notably, Python 2 support has been dropped (the current implementation has workarounds for asyncio
support via trollius
). The datagram protocol itself has been refactored to remove it's factory implementation in favor of inline lambdas. Error handling has been extended to check the interface IP type, and to use new module exceptions. Error messages have been changed as well to be easier to grok. Logging statements have been adjusted as well to make it easier to follow the logic from the log output.
Configuration documentation has been added for both the master and the minion. This explains how to configure the interface IP, as well as the rest of the functionality already provided.
Unit tests have been updated to pass with the new changes.
Previous Behavior
Auto-discovery server and client interface IP could not be changed or configured, and may send datagrams on multiple or unintended interfaces, or with invalid interface IP data.
New Behavior
Auto-discovery server and client now support configuring the interface IP.
Merge requirements satisfied?
[NOTICE] Bug fixes or features added to Salt require tests.
- [Y] Docs
- [N] Changelog - https://docs.saltstack.com/en/master/topics/development/changelog.html
- [Y] Tests written/updated
Commits signed with GPG?
Yes
Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here’s some information that may help as you continue your Salt journey. Please be sure to review our Code of Conduct. Also, check out some of our community resources including:
- Community Wiki
- Salt’s Contributor Guide
- Join our Community Slack
- IRC on Freenode
- SaltStack YouTube channel
- SaltStackInc Twitch channel
There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar. If you have additional questions, email us at [email protected]. We’re glad you’ve joined our community and look forward to doing awesome things with you!
re-run all
Just wondering if I could get another look at this; I see the tests were re-ran. Not sure what the next step is as I've never contributed to SaltStack before.
This is awesome, why has no one approved this? The discovery feature is massively underrated and this would fix so many issues.
@zmingee Can you please fix the conflicts in this?
Closing this due to inactivity. Anyone should feel free to re-open it if they want to see it through to the end in one release cycle.