fix: use generic set in pkg/util/iptables
This commit is contained in:
@@ -446,7 +446,6 @@ func iptablesRestoreCommand(protocol Protocol) string {
|
||||
return cmdIP6TablesRestore
|
||||
}
|
||||
return cmdIPTablesRestore
|
||||
|
||||
}
|
||||
|
||||
func iptablesCommand(protocol Protocol) string {
|
||||
@@ -509,10 +508,10 @@ func (runner *runner) checkRuleWithoutCheck(table Table, chain Chain, args ...st
|
||||
tmpField = trimhex(tmpField)
|
||||
argsCopy = append(argsCopy, strings.Fields(tmpField)...)
|
||||
}
|
||||
argset := sets.NewString(argsCopy...)
|
||||
argset := sets.New(argsCopy...)
|
||||
|
||||
for _, line := range strings.Split(string(out), "\n") {
|
||||
var fields = strings.Fields(line)
|
||||
fields := strings.Fields(line)
|
||||
|
||||
// Check that this is a rule for the correct chain, and that it has
|
||||
// the correct number of argument (+2 for "-A <chain name>")
|
||||
@@ -528,7 +527,7 @@ func (runner *runner) checkRuleWithoutCheck(table Table, chain Chain, args ...st
|
||||
}
|
||||
|
||||
// TODO: This misses reorderings e.g. "-x foo ! -y bar" will match "! -x foo -y bar"
|
||||
if sets.NewString(fields...).IsSuperset(argset) {
|
||||
if sets.New(fields...).IsSuperset(argset) {
|
||||
return true, nil
|
||||
}
|
||||
klog.V(5).InfoS("DBG: fields is not a superset of args", "fields", fields, "arguments", args)
|
||||
@@ -603,7 +602,6 @@ func (runner *runner) Monitor(canary Chain, tables []Table, reloadFunc func(), i
|
||||
}
|
||||
return true, nil
|
||||
}, stopCh)
|
||||
|
||||
if err != nil {
|
||||
// stopCh was closed
|
||||
for _, table := range tables {
|
||||
|
Reference in New Issue
Block a user