-
Notifications
You must be signed in to change notification settings - Fork 260
[NPM] generic Policy Manager and some windows specific policy updates #1045
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
huntergregory
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.
updatePod() can be more efficient using the algorithm I designed, and I think we might have some disconnect with AddIPSetReferences()
| err := dp.ipsetMgr.AddReference(set.Name, netpolName, referenceType) | ||
| if err != nil { | ||
| return err | ||
| npmErrorString := npmerrors.AddSelectorReference |
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 don't have a super strong preference, but can we consolidate these four lines into a function since it happens 4+ times?
| return nil | ||
| } | ||
|
|
||
| func (dp *DataPlane) addIPSetReferences(sets map[string]*ipsets.IPSet, netpolName string, referenceType ipsets.ReferenceType) error { |
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.
can we rename this and deleteIPSetReferences? Maybe createIPSetsAndAddReference? Name is confusing with ipsetMgr.AddReference
huntergregory
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 can address minor comments above in another PR
This PR includes following changes: