Skip to content
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

Merged
merged 2 commits into from
Dec 8, 2023

Conversation

axel7born
Copy link
Contributor

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:

Remove the optional creation of iptables rules and the flag`--setup-iptables`.

@axel7born axel7born requested a review from a team as a code owner December 8, 2023 13:16
@gardener-robot gardener-robot added needs/review Needs review size/xl Size of pull request is huge (see gardener-robot robot/bots/size.py) needs/second-opinion Needs second review by someone else labels Dec 8, 2023
@gardener-robot-ci-1 gardener-robot-ci-1 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Dec 8, 2023
Copy link
Member

@ScheererJ ScheererJ left a 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.

Comment on lines 44 to 45
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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()

@gardener-robot gardener-robot added the needs/changes Needs (more) changes label Dec 8, 2023
@gardener-robot-ci-3 gardener-robot-ci-3 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Dec 8, 2023
@gardener-robot-ci-1 gardener-robot-ci-1 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Dec 8, 2023
Copy link
Member

@ScheererJ ScheererJ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@gardener-robot gardener-robot added reviewed/lgtm Has approval for merging and removed needs/changes Needs (more) changes needs/review Needs review needs/second-opinion Needs second review by someone else labels Dec 8, 2023
@gardener-robot-ci-3 gardener-robot-ci-3 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Dec 8, 2023
@axel7born axel7born merged commit c362778 into gardener:master Dec 8, 2023
@gardener-robot gardener-robot added the status/closed Issue is closed (either delivered or triaged) label Dec 8, 2023
@axel7born axel7born deleted the remove-iptables branch December 8, 2023 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) reviewed/lgtm Has approval for merging reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) size/xl Size of pull request is huge (see gardener-robot robot/bots/size.py) status/closed Issue is closed (either delivered or triaged)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants