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

Expose ip tables package #361

Merged
merged 4 commits into from
Apr 3, 2024
Merged

Expose ip tables package #361

merged 4 commits into from
Apr 3, 2024

Conversation

zaharidichev
Copy link
Member

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.

Signed-off-by: Zahari Dichev <zaharidichev@gmail.com>
Signed-off-by: Zahari Dichev <zaharidichev@gmail.com>
@zaharidichev zaharidichev requested a review from a team as a code owner April 1, 2024 07:43
@zaharidichev
Copy link
Member Author

cc @alpeb

Signed-off-by: Zahari Dichev <zaharidichev@gmail.com>
Copy link
Member

@alpeb alpeb left a 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 👍

Comment on lines 170 to 173
// 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)
Copy link
Member

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".

return nil
}

// CleanupFirewallConfig removed the iptables rules that have been added as a result of
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
// 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 <zaharidichev@gmail.com>
@zaharidichev zaharidichev merged commit 705be3c into main Apr 3, 2024
21 checks passed
@zaharidichev zaharidichev deleted the zd/non-internal branch April 3, 2024 12:27
zaharidichev added a commit that referenced this pull request Jun 6, 2024
- enable the use iptables as a library
- adda functionality to remove already configured rules.

Signed-off-by: Zahari Dichev <zaharidichev@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants