-
Notifications
You must be signed in to change notification settings - Fork 260
fix/refactor: [NPM] eliminate struct fields to prevent errors & reduce memory #1374
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
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.
minor comments
| selectorIpSets[ipset.Metadata.GetPrefixName()] = struct{}{} | ||
| } | ||
|
|
||
| klog.Infof("policy %s has policy selector: %+v", policy.PolicyKey, selectorIpSets) // FIXME remove after debugging |
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.
do you want to remove this line?
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.
gonna fix the bug related to these print statements in a followup PR
|
|
||
| func (dp *DataPlane) getSelectorIPsByPolicyName(policyName string) (map[string]struct{}, error) { | ||
| policy, ok := dp.policyMgr.GetPolicy(policyName) | ||
| func (dp *DataPlane) getSelectorIPsByPolicyName(policyKey string) (map[string]struct{}, 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.
probably update this func name to getSelectorIPsByPolicyKey
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.
let me fix the followup PR?
| dp.endpointCache[ep.IP] = ep | ||
| klog.Infof("updating endpoint cache to include %s: %+v", ep.IP, ep) // FIXME remove after debugging | ||
| } | ||
| klog.Infof("endpoint cache after refreshing all pod endpoints: %+v", dp.endpointCache) // FIXME remove after debugging |
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.
remove these prints ?
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.
gonna fix the bug related to these print statements in a followup PR
| // aclPolicyID returns azure-acl-<network policy namespace>-<network policy name> format | ||
| // to differentiate ACLs among different network policies, | ||
| // but aclPolicy in the same network policy has the same aclPolicyID. | ||
| func aclPolicyID(policyNS, policyName string) string { |
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.
No strong opinion, but we can keep this in common policy.go
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.
not adamant either, but prefer to let Linux return an empty string to keep in par with separate dirty cache etc. between OS's
…e memory (Azure#1374) * remove Name field from NPMNetworkPolicy * wip moving acl policy id * fix policy key typo for removing Name field * fix lint and log * temp debug logs * another debug log * update a couple UTs
…e memory (Azure#1374) * remove Name field from NPMNetworkPolicy * wip moving acl policy id * fix policy key typo for removing Name field * fix lint and log * temp debug logs * another debug log * update a couple UTs
Uh oh!
There was an error while loading. Please reload this page.