-
Notifications
You must be signed in to change notification settings - Fork 472
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
Convert 0.0.0.0 to local ip addresses when matching the cluster node #1392
Conversation
@zevin02 It's very handy to run |
Hi @zevin02, thanks for your contribution! We setup lots of code checks in our CI, which requires you to pass for better code quality. For example, from a glance to your code, maybe these checks will fail:
You can check the CI log for more details and for how to modify your code to pass the CI. It is recommended to try some commands to solve these problems, but maybe not all problems:
Another thing is that, it would be better to have some unit tests for this function before it is merged : ) |
fixes: apache#1381 - Add a function to get all local IP addresses Signed-off-by: Zewen Xu <zevin9427@gmail.com>
- Move the `GetLocalIpAddresses` function to `common/io_util.cc` - Add `common/io_util.h` header to `cluster/cluster.h` - Use `util::GetLocalIpAddresses()` instead of the previously defined function in `cluster.cc` Signed-off-by: Zewen Xu <zevin9427@gmail.com>
@PragmaTwice I think I solved all the problems, can you give me a review |
Sure! But as I mentioned in #1392 (comment), you need first to make the CI pass, which currently failed.
|
Signed-off-by: Zewen Xu <zevin9427@gmail.com>
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.
The rest looks good to me. cc @git-hulk
@PragmaTwice I do a minor refactor, can help to take a look again. |
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.
Generally, LGTM, but I have a few comments.
- Check for IPv6 addresses in `MatchListeningIP` - Remove unnecessary comment about loopback addresses in `GetLocalIPAddresses` Signed-off-by: Zewen Xu <zevin9427@gmail.com>
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
Thanks for your contribution! Merging... |
fixes: #1381