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

Refine the security policy logic related with named port #796

Merged
merged 1 commit into from
Oct 28, 2024

Conversation

wenyingd
Copy link
Contributor

Fix: #795

@codecov-commenter
Copy link

codecov-commenter commented Oct 10, 2024

Codecov Report

Attention: Patch coverage is 97.59036% with 2 lines in your changes missing coverage. Please review.

Project coverage is 53.81%. Comparing base (ff32eb4) to head (f5b65f1).

Files with missing lines Patch % Lines
pkg/nsx/services/securitypolicy/expand.go 93.75% 1 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #796      +/-   ##
==========================================
+ Coverage   53.20%   53.81%   +0.61%     
==========================================
  Files          95       95              
  Lines       15029    15018      -11     
==========================================
+ Hits         7996     8082      +86     
+ Misses       6468     6360     -108     
- Partials      565      576      +11     
Flag Coverage Δ
unit-tests 53.81% <97.59%> (+0.61%) ⬆️
Files with missing lines Coverage Δ
pkg/nsx/services/securitypolicy/builder.go 82.30% <100.00%> (+0.47%) ⬆️
pkg/nsx/services/securitypolicy/expand.go 62.23% <93.75%> (+30.08%) ⬆️

... and 1 file with indirect coverage changes

@wenyingd wenyingd force-pushed the refine_namedport branch 3 times, most recently from 31ed666 to 04c0593 Compare October 10, 2024 12:56
@wenyingd
Copy link
Contributor Author

@timdengyun Added test case TestExpandRule, and it is verified that function service.expandRule with this change has generated the same NSX groups, NSX rules as before.

@wenyingd
Copy link
Contributor Author

/e2e

1 similar comment
@wenyingd
Copy link
Contributor Author

/e2e

Copy link
Contributor

@timdengyun timdengyun left a comment

Choose a reason for hiding this comment

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

The whole logic is pretty good, and good refactor to improve readability
Moreover, it make the logic more clear and less error prone as well.
Thanks so much, much appreciation.

pkg/nsx/services/securitypolicy/builder.go Show resolved Hide resolved
pkg/nsx/services/securitypolicy/builder.go Outdated Show resolved Hide resolved
pkg/nsx/services/securitypolicy/builder.go Outdated Show resolved Hide resolved
pkg/nsx/services/securitypolicy/builder.go Outdated Show resolved Hide resolved
pkg/nsx/services/securitypolicy/expand_test.go Outdated Show resolved Hide resolved
pkg/nsx/services/securitypolicy/expand_test.go Outdated Show resolved Hide resolved
pkg/nsx/services/securitypolicy/expand_test.go Outdated Show resolved Hide resolved
pkg/nsx/services/securitypolicy/expand_test.go Outdated Show resolved Hide resolved
timdengyun
timdengyun previously approved these changes Oct 16, 2024
Copy link
Contributor

@timdengyun timdengyun left a comment

Choose a reason for hiding this comment

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

LGTM

pkg/nsx/services/securitypolicy/builder.go Show resolved Hide resolved
Copy link
Contributor

@timdengyun timdengyun left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@zhengxiexie zhengxiexie left a comment

Choose a reason for hiding this comment

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

LGTM

@timdengyun timdengyun merged commit 563e297 into vmware-tanzu:main Oct 28, 2024
1 check passed
timdengyun pushed a commit to timdengyun/nsx-operator-1 that referenced this pull request Oct 28, 2024
timdengyun added a commit that referenced this pull request Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor namedport logic
4 participants