Skip to content
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 the AddressGroup duplicated deleted bug #3136

Merged
merged 1 commit into from
Jan 6, 2022

Conversation

Jexf
Copy link
Member

@Jexf Jexf commented Dec 14, 2021

Use sets instead of slice to resolve duplicated AddressGroup key problem when generating AddressGroup keys from NetworkPolicy rules.

Fixes: #3135

Signed-off-by: Wu zhengdong zhengdong.wu@transwarp.io

@Jexf
Copy link
Member Author

Jexf commented Dec 14, 2021

/test-all

@codecov-commenter
Copy link

codecov-commenter commented Dec 14, 2021

Codecov Report

Merging #3136 (a1ea0c3) into main (a5114e7) will increase coverage by 18.24%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##             main    #3136       +/-   ##
===========================================
+ Coverage   40.35%   58.59%   +18.24%     
===========================================
  Files         167      295      +128     
  Lines       20879    24907     +4028     
===========================================
+ Hits         8426    14595     +6169     
+ Misses      11632     8733     -2899     
- Partials      821     1579      +758     
Flag Coverage Δ
kind-e2e-tests 44.97% <100.00%> (?)
unit-tests 40.36% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...ntroller/networkpolicy/networkpolicy_controller.go 82.64% <100.00%> (+13.88%) ⬆️
pkg/apiserver/handlers/webhook/convert_crd.go 2.56% <0.00%> (ø)
pkg/apiserver/handlers/webhook/mutation_labels.go 24.71% <0.00%> (ø)
...rsioned/typed/security/v1alpha1/security_client.go 56.00% <0.00%> (ø)
pkg/legacyclient/clientset/versioned/clientset.go 25.80% <0.00%> (ø)
...formers/externalversions/security/v1alpha1/tier.go 64.28% <0.00%> (ø)
pkg/legacyapis/controlplane/register.go 88.23% <0.00%> (ø)
pkg/legacyclient/listers/security/v1alpha1/tier.go 9.09% <0.00%> (ø)
...egator/apiserver/handlers/recordmetrics/handler.go 0.00% <0.00%> (ø)
pkg/agent/route/route_linux.go 26.88% <0.00%> (ø)
... and 233 more

@Jexf
Copy link
Member Author

Jexf commented Dec 14, 2021

/test-integration
/test-all

tnqn
tnqn previously approved these changes Dec 16, 2021
Copy link
Member

@tnqn tnqn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
@Jexf thanks for fixing it. I believe I saw error logs caused by it before and forgot to follow up.

@tnqn
Copy link
Member

tnqn commented Dec 16, 2021

nit: in the commit message "when generating AddressGroup keys from NetworkPolicy rules."

Use sets instead of slice to resolve duplicated AddressGroup key
problem when generating AddressGroup keys from NetworkPolicy rules.

Signed-off-by: Wu zhengdong <zhengdong.wu@transwarp.io>
@Jexf
Copy link
Member Author

Jexf commented Dec 16, 2021

nit: in the commit message "when generating AddressGroup keys from NetworkPolicy rules."
@tnqn Thanks for the review, updated

@Jexf Jexf added the area/network-policy/controller Issues or PRs related to the network policy controller label Dec 16, 2021
@Jexf Jexf requested a review from tnqn December 16, 2021 12:21
@Jexf
Copy link
Member Author

Jexf commented Dec 16, 2021

/test-all

Copy link
Member

@tnqn tnqn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tnqn
Copy link
Member

tnqn commented Dec 16, 2021

@Jexf there are some issues with the CI this week, so all PRs are pending for merging. I will take care of merging it once it's back to normal.

@tnqn
Copy link
Member

tnqn commented Jan 6, 2022

/skip-all I have validated the required checks manually.

@tnqn tnqn merged commit a7bf09b into antrea-io:main Jan 6, 2022
@Jexf Jexf deleted the fix-delete-addressgroup branch January 10, 2022 03:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/network-policy/controller Issues or PRs related to the network policy controller
Projects
None yet
Development

Successfully merging this pull request may close these issues.

duplicated deleting related AddressGroups action in deleting ClusterNetworkPolicy process
3 participants