-
Notifications
You must be signed in to change notification settings - Fork 370
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
Fix not dedup Priorities in batch register #1841
Fix not dedup Priorities in batch register #1841
Conversation
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.
LGTM
assert.Equalf(t, nil, err, "Error occurred in priority registration") | ||
_, _, err2 := pa2.RegisterPriorities(prioritiesToRegisterDuplicate) | ||
assert.Equalf(t, nil, err2, "Error occurred in priority registration") | ||
ofPriority1130, _ := pa1.GetOFPriority(p1130) | ||
ofPriority1130Dup, _ := pa2.GetOFPriority(p1130) | ||
assert.Equal(t, ofPriority1130, ofPriority1130Dup) | ||
ofPriority1131, _ := pa1.GetOFPriority(p1131) | ||
ofPriority1131Dup, _ := pa2.GetOFPriority(p1131) | ||
assert.Equal(t, ofPriority1131, ofPriority1131Dup) |
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.
please use assert.NoError(t, err, ...)
for errors
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.
Fixed for the entire test file.
09499fa
to
8275976
Compare
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.
LGTM
/test-all |
Codecov Report
@@ Coverage Diff @@
## main #1841 +/- ##
=======================================
Coverage ? 42.88%
=======================================
Files ? 196
Lines ? 16658
Branches ? 0
=======================================
Hits ? 7143
Misses ? 8510
Partials ? 1005
Flags with carried forward coverage won't be shown. Click here to find out more. |
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.
LGTM, thanks for fixing it.
When Antrea agent is restarted, all Antrea-native policy priorities will be registered in batch. On a specific Node, there can be a large number of Antrea-native policies of the same Tier and policy priority. Hence, the list of types.Priority to be registered can contain duplicates, but it is not correctly handled by the priorityAssigner. Hence, the resulting ofPriority for a specific policy Priority can be inconsistent between batch registration and individual registration. This PR fixes this issue.