-
Notifications
You must be signed in to change notification settings - Fork 19
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
Remove iptables related code. #70
Conversation
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.
Thanks for the big simplification. I have just a minor change request.
internal/app/app.go
Outdated
err := c.netManager.RemoveIPAddress() | ||
|
||
if c.params.SetupIptables { | ||
for _, rule := range c.iptablesRules { | ||
exists := true | ||
for exists { | ||
err := c.iptables.DeleteRule(rule.table, rule.chain, rule.args...) | ||
if err != nil { | ||
klog.Errorf("Error deleting iptables rule %v - %s", rule, err) | ||
} | ||
exists, _ = c.iptables.EnsureRule(utiliptables.Prepend, rule.table, rule.chain, rule.args...) | ||
} | ||
// Delete the rule one last time since EnsureRule creates the rule if it doesn't exist | ||
err := c.iptables.DeleteRule(rule.table, rule.chain, rule.args...) | ||
if err != nil { | ||
klog.Errorf("Error deleting iptables rule %v - %s", rule, err) | ||
} | ||
} | ||
} | ||
|
||
return err |
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.
err := c.netManager.RemoveIPAddress() | |
if c.params.SetupIptables { | |
for _, rule := range c.iptablesRules { | |
exists := true | |
for exists { | |
err := c.iptables.DeleteRule(rule.table, rule.chain, rule.args...) | |
if err != nil { | |
klog.Errorf("Error deleting iptables rule %v - %s", rule, err) | |
} | |
exists, _ = c.iptables.EnsureRule(utiliptables.Prepend, rule.table, rule.chain, rule.args...) | |
} | |
// Delete the rule one last time since EnsureRule creates the rule if it doesn't exist | |
err := c.iptables.DeleteRule(rule.table, rule.chain, rule.args...) | |
if err != nil { | |
klog.Errorf("Error deleting iptables rule %v - %s", rule, err) | |
} | |
} | |
} | |
return err | |
return c.netManager.RemoveIPAddress() |
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
What this PR does / why we need it:
This PR removes the code for the optional creation of iptables rules and the
--setup-iptables
flag. To our knowledge, this code is not being used and is not necessary, so we have decided to discontinue maintaining the iptables-related code.Since we are also removing the associated flag, this constitutes a breaking change. Therefore, along with the image update, it is crucial to ensure that the
--setup-iptables
flag is no longer in use.Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Release note: