Skip to content

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

3 participants