mirror of
https://github.com/cloudnativelabs/kube-router.git
synced 2025-11-20 20:41:06 +01:00
while doing ipset restore, ensure sets are flushed before adding entries
This commit is contained in:
parent
187a3f23c5
commit
99cb40b086
@ -403,6 +403,7 @@ func buildIPSetRestore(ipset *IPSet) string {
|
|||||||
ipSetRestore := ""
|
ipSetRestore := ""
|
||||||
for _, set := range ipset.Sets {
|
for _, set := range ipset.Sets {
|
||||||
ipSetRestore += fmt.Sprintf("create %s %s\n", set.Name, strings.Join(set.Options[:], " "))
|
ipSetRestore += fmt.Sprintf("create %s %s\n", set.Name, strings.Join(set.Options[:], " "))
|
||||||
|
ipSetRestore += fmt.Sprintf("flush %s\n", set.Name)
|
||||||
for _, entry := range set.Entries {
|
for _, entry := range set.Entries {
|
||||||
ipSetRestore += fmt.Sprintf("add %s %s\n", set.Name, strings.Join(entry.Options[:], " "))
|
ipSetRestore += fmt.Sprintf("add %s %s\n", set.Name, strings.Join(entry.Options[:], " "))
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user