-
Notifications
You must be signed in to change notification settings - Fork 366
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 status report of Antrea-native policies #3074
Conversation
/test-e2e |
Codecov Report
@@ Coverage Diff @@
## main #3074 +/- ##
==========================================
+ Coverage 59.79% 61.84% +2.05%
==========================================
Files 292 292
Lines 24732 34550 +9818
==========================================
+ Hits 14788 21369 +6581
- Misses 8317 11408 +3091
- Partials 1627 1773 +146
Flags with carried forward coverage won't be shown. Click here to find out more.
|
c1ce15c
to
0347c45
Compare
/test-all |
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
c.policyMapLock.Lock() | ||
defer c.policyMapLock.Unlock() | ||
return c.updateNetworkPolicyLocked(policy) | ||
} | ||
|
||
func (c *ruleCache) updateNetworkPolicyLocked(policy *v1beta.NetworkPolicy) error { | ||
func (c *ruleCache) updateNetworkPolicyLocked(policy *v1beta.NetworkPolicy) bool { |
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.
maybe add a function comment to explain what the return value stands for
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.
Done
0347c45
to
32c4c34
Compare
For an Antrea-native policy with multiple rules that have different AppliedTo, some rules may not be effective on a Node when the policy applies to the Node. In this case, antrea-agent didn't make any actual dataplane change and didn't report new status to antrea-controller if the only changed part of a policy event is about the ineffective rules, even though the generation of the policy may have changed. This leads to a policy staying in realizing state because of the missing status report. This patch fixes it by triggering status report at least once as long as a policy is actually updated. In addition, it removes some useless return value and changes the order of event logs to better reflect the cause of policy reconciliation. Signed-off-by: Quan Tian <qtian@vmware.com>
32c4c34
to
cde4d67
Compare
/test-all |
For an Antrea-native policy with multiple rules that have different AppliedTo, some rules may not be effective on a Node when the policy applies to the Node. In this case, antrea-agent didn't make any actual dataplane change and didn't report new status to antrea-controller if the only changed part of a policy event is about the ineffective rules, even though the generation of the policy may have changed. This leads to a policy staying in realizing state because of the missing status report. This patch fixes it by triggering status report at least once as long as a policy is actually updated. In addition, it removes some useless return value and changes the order of event logs to better reflect the cause of policy reconciliation. Signed-off-by: Quan Tian <qtian@vmware.com>
For an Antrea-native policy with multiple rules that have different AppliedTo, some rules may not be effective on a Node when the policy applies to the Node. In this case, antrea-agent didn't make any actual dataplane change and didn't report new status to antrea-controller if the only changed part of a policy event is about the ineffective rules, even though the generation of the policy may have changed. This leads to a policy staying in realizing state because of the missing status report.
This patch fixes it by triggering status report at least once as long as a policy is actually updated. In addition, it removes some useless return value and changes the order of event logs to better reflect the cause of policy reconciliation.
Signed-off-by: Quan Tian qtian@vmware.com
Fixes #3075