Skip to content

Commit

Permalink
update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
leosarra committed May 16, 2024
1 parent 167a40e commit e96244f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tools/istio-iptables/pkg/builder/iptables_builder_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,9 @@ func (rb *IptablesRuleBuilder) buildCleanupRules(rules []*Rule) [][]string {
chainTableLookupSet := sets.New[string]()
for _, r := range newRules {
chainTable := fmt.Sprintf("%s:%s", r.chain, r.table)
// Create new chain if key: `chainTable` isn't present in map
// Delete chain if key: `chainTable` isn't present in map
if !chainTableLookupSet.Contains(chainTable) {
// Ignore chain creation for built-in chains for iptables
// Don't delete iptables built-in chains
if _, present := constants.BuiltInChainsMap[r.chain]; !present {
cmd := []string{"-X", r.chain}
output = append(output, cmd)
Expand Down Expand Up @@ -254,9 +254,9 @@ func (rb *IptablesRuleBuilder) buildCleanupRulesRestore(rules []*Rule) string {
chainTableLookupMap := sets.New[string]()
for _, r := range newRules {
chainTable := fmt.Sprintf("%s:%s", r.chain, r.table)
// Create new chain if key: `chainTable` isn't present in map
// Delete chain if key: `chainTable` isn't present in map
if !chainTableLookupMap.Contains(chainTable) {
// Ignore chain creation for built-in chains for iptables
// Don't delete iptables built-in chains
if _, present := constants.BuiltInChainsMap[r.chain]; !present {
tableRulesMap[r.table] = append(tableRulesMap[r.table], fmt.Sprintf("-X %s", r.chain))
chainTableLookupMap.Insert(chainTable)
Expand Down

0 comments on commit e96244f

Please sign in to comment.