-
Notifications
You must be signed in to change notification settings - Fork 33
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
Expose ip tables package #361
Conversation
Signed-off-by: Zahari Dichev <[email protected]>
Signed-off-by: Zahari Dichev <[email protected]>
cc @alpeb |
Signed-off-by: Zahari Dichev <[email protected]>
67f303c
to
dcb5582
Compare
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.
Looks good to me, just a couple of nits 👍
pkg/iptables/iptables.go
Outdated
// formatComment is used to format iptables comments in such way that it is possible to identify when the rules were added. | ||
// This helps debug when iptables has some stale rules from previous runs, something that can happen frequently on minikube. | ||
func formatComment(text string) string { | ||
return fmt.Sprintf("proxy-init/%s/%s", text, ExecutionTraceID) | ||
return fmt.Sprintf("proxy-init/%s", text) |
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.
Now that the timestamp is not included, this function comment should be amended to not make mention of "when the rules were added".
pkg/iptables/iptables.go
Outdated
return nil | ||
} | ||
|
||
// CleanupFirewallConfig removed the iptables rules that have been added as a result of |
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.
// CleanupFirewallConfig removed the iptables rules that have been added as a result of | |
// CleanupFirewallConfig removes the iptables rules that have been added as a result of |
Signed-off-by: Zahari Dichev <[email protected]>
- enable the use iptables as a library - adda functionality to remove already configured rules. Signed-off-by: Zahari Dichev <[email protected]>
In order to enable the use iptables as a library, this change moves it our of the internal package. Additionally, this PR adds functionality to remove already configured iptables.