-
Notifications
You must be signed in to change notification settings - Fork 7.8k
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
fix reload network endpoints #42825
fix reload network endpoints #42825
Conversation
Signed-off-by: Rama Chavali <rama.rao@salesforce.com>
🤔 🐛 You appear to be fixing a bug in Go code, yet your PR doesn't include updates to any test files. Did you forget to add a test? Courtesy of your friendly test nag. |
This regressed as part of this #42818. Sorry about that |
Signed-off-by: Rama Chavali <rama.rao@salesforce.com>
pilot/pkg/model/network.go
Outdated
@@ -124,7 +124,7 @@ func (mgr *NetworkManager) reloadNetworkEndpoints() { | |||
for _, networkconf := range oldNetworks.Networks { | |||
for _, ne := range networkconf.Endpoints { |
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.
better to rename ne
as well
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.
Done.
for _, ne := range networkconf.Endpoints { | ||
if len(ne.GetFromCidr()) > 0 { | ||
newEndpoints = append(newEndpoints, ne) | ||
for _, oe := range networkconf.Endpoints { |
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.
One of my new year resolutions is to start asking for more comments in the code :-). Few lines of comments explaining why we are doing this would help.
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 from correctness part
Fixes #42818