-
Notifications
You must be signed in to change notification settings - Fork 260
NPM v2 Linux IPSet Manager #1029
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
Conversation
|
Adding some notes on changes to generic ipsetmanager in this PR |
vakalapa
left a comment
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.
We will need to abstract files part, and also incorporate some diff calculation logic on deleting existing members
| // DEBUGGING | ||
| fmt.Printf("DEBUG-ME\nname: %s\nkind: %s\npodip: \n", set.Name, set.Kind) | ||
| fmt.Println(set.IPPodKey) | ||
| fmt.Println("members: ") |
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.
How are we managing deleting existing members of an ipset ?
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.
in updateMembers(), we flush the set before adding each member
This reverts commit b20c486.
vakalapa
left a comment
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.
initial CR
This reverts commit b53af2c.
|
Noting that in a second pass, we need to make 2 changes because ipset restore will commit lines before a line that fails.
|
| // TODO add error handler? | ||
| creator.AddLine(sectionID, nil, util.IpsetAppendFlag, set.HashedName, ip) // add IP | ||
| } | ||
| } else { |
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.
Check if after flush and error occured while adding, will there be an issue or a time gap between flushed state and actual state
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.
wrote a comment above about how we should address this
|
azp run |
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
|
|
||
| commandString := cmd + " " + strings.Join(args, " ") | ||
| stdErr := string(stdErrBytes) | ||
| log.Errorf("on try number %d, failed to run command [%s] with error [%v] and stdErr [%s]. Used file:\n%s", creator.tryCount, commandString, err, stdErr, fileString) |
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.
We should be using klogf since thats the norm in other packages.
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.
TODO in another PR
noting our plan for # 1 to use |
vakalapa
left a comment
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.
🚀 Send it
Reason for Change:
Linux implementation of new NPM with batch ipset-restore calls and error handling. Flushes anything in the dirty cache and adds all current members instead of calculating a diff.
Includes a tool for creating restore files and handling errors (will use for iptables too).
Also implements ApplyAll mode and introduces a reboot function for ipsetmanager.
Issue Fixed:
Requirements:
Notes: