-
Notifications
You must be signed in to change notification settings - Fork 335
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
chore(*) add transparent-proxy firewalld support #1702
Conversation
Signed-off-by: Nikolay Nikolaev <nikolay.nikolaev@konghq.com>
Signed-off-by: Nikolay Nikolaev <nikolay.nikolaev@konghq.com>
Signed-off-by: Nikolay Nikolaev <nikolay.nikolaev@konghq.com>
Signed-off-by: Nikolay Nikolaev <nikolay.nikolaev@konghq.com>
Signed-off-by: Nikolay Nikolaev <nikolay.nikolaev@konghq.com>
parser := regexp.MustCompile(`\* (?P<table>\w*)`) | ||
rules := map[string][]string{} | ||
|
||
lines := strings.Split(output, "\n") |
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.
I'd better use bufio.Scanner
and bufio.ScanLines
to read line by line in a platform-agnostic way
|
||
matches := parser.FindStringSubmatch(line) | ||
if len(matches) > 1 { | ||
table = matches[0] |
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.
matches[0]
contains the most matched part of line
like * nat
for example, since you have named captured group table
you can use matches[parser.SubexpIndex("table")]
Signed-off-by: Nikolay Nikolaev <nicknickolaev@gmail.com>
type IptablesTranslator interface { | ||
// store iptables rules | ||
// accepts a map of slices, the map key is the iptables table | ||
// and the slices aare the list of the iptables rules in that table |
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.
aare
-> are
@Mergifyio update |
Command
|
|
* chore(*) firewalld translation from iptables * chore(*) kumactl install with firewalld Signed-off-by: Nikolay Nikolaev <nicknickolaev@gmail.com> (cherry picked from commit 47009e1)
* chore(*) firewalld translation from iptables * chore(*) kumactl install with firewalld Signed-off-by: Nikolay Nikolaev <nicknickolaev@gmail.com> (cherry picked from commit 47009e1) Co-authored-by: Nikolay Nikolaev <nikolay.nikolaev@konghq.com>
Summary
Add support for firewalld persistent storage of iptables
Issues resolved
Fix #1692
Documentation