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

Add MatchExpression support for SecurityPolicy #38

Merged
merged 1 commit into from
Jan 29, 2022

Conversation

timdengyun
Copy link
Contributor

@timdengyun timdengyun commented Jan 19, 2022

1.Support MatchExpression Operator: 'NotIn', 'Exists',
'DoesNotExist' for VM/Pod/Namespace label selectors
in SecurityPolicy

2.Given NSX doesn't support MatchExpression Operator 'In',
and only five criteria are allowed currently,
which results into a gigantic group expression body to be passed to NSX.
So, only allow just one Operator 'In' MatchExpressions with at most
of five values in it.

3.Add NSX-T limitation and NSGroup Criteria check

@timdengyun
Copy link
Contributor Author

To add UT later.

@timdengyun timdengyun force-pushed the AddMatchExpressionSupport branch from 0ec398d to 0cbaa4b Compare January 19, 2022 06:40
pkg/nsx/services/firewall.go Outdated Show resolved Hide resolved
pkg/nsx/services/firewall.go Outdated Show resolved Hide resolved
pkg/nsx/services/firewall.go Outdated Show resolved Hide resolved
pkg/nsx/services/firewall.go Outdated Show resolved Hide resolved
@timdengyun timdengyun force-pushed the AddMatchExpressionSupport branch from 0cbaa4b to 5994811 Compare January 21, 2022 01:22
@timdengyun timdengyun requested a review from dantingl January 21, 2022 01:23
pkg/nsx/services/firewall.go Show resolved Hide resolved
pkg/nsx/services/firewall.go Outdated Show resolved Hide resolved
pkg/nsx/services/firewall.go Outdated Show resolved Hide resolved
pkg/nsx/services/firewall.go Outdated Show resolved Hide resolved
pkg/nsx/services/firewall.go Outdated Show resolved Hide resolved
pkg/nsx/services/firewall.go Outdated Show resolved Hide resolved
pkg/nsx/services/firewall.go Outdated Show resolved Hide resolved
pkg/nsx/services/firewall.go Outdated Show resolved Hide resolved
pkg/nsx/services/firewall.go Outdated Show resolved Hide resolved
pkg/nsx/services/firewall.go Outdated Show resolved Hide resolved
pkg/nsx/services/firewall.go Outdated Show resolved Hide resolved
pkg/nsx/services/firewall.go Outdated Show resolved Hide resolved
pkg/nsx/services/firewall.go Outdated Show resolved Hide resolved
pkg/util/utils.go Outdated Show resolved Hide resolved
pkg/nsx/services/firewall.go Outdated Show resolved Hide resolved
@timdengyun timdengyun force-pushed the AddMatchExpressionSupport branch from 5994811 to dc0a843 Compare January 25, 2022 11:00
@timdengyun timdengyun force-pushed the AddMatchExpressionSupport branch 5 times, most recently from db45a65 to 796d61f Compare January 26, 2022 09:40
pkg/nsx/services/firewall.go Outdated Show resolved Hide resolved
pkg/nsx/services/firewall.go Outdated Show resolved Hide resolved
pkg/nsx/services/firewall.go Outdated Show resolved Hide resolved
pkg/nsx/services/firewall.go Outdated Show resolved Hide resolved
pkg/nsx/services/firewall.go Outdated Show resolved Hide resolved
pkg/nsx/services/firewall.go Outdated Show resolved Hide resolved
pkg/nsx/services/firewall.go Outdated Show resolved Hide resolved
@timdengyun timdengyun force-pushed the AddMatchExpressionSupport branch from 796d61f to c3e02db Compare January 27, 2022 10:48
@timdengyun timdengyun requested a review from heypnus January 27, 2022 10:50
@timdengyun timdengyun force-pushed the AddMatchExpressionSupport branch 2 times, most recently from 89abb20 to 3f6eb15 Compare January 27, 2022 13:56
pkg/nsx/services/firewall.go Outdated Show resolved Hide resolved
pkg/nsx/services/firewall.go Outdated Show resolved Hide resolved
pkg/nsx/services/firewall.go Outdated Show resolved Hide resolved
pkg/nsx/services/firewall.go Outdated Show resolved Hide resolved
pkg/nsx/services/firewall.go Outdated Show resolved Hide resolved
pkg/nsx/services/firewall.go Outdated Show resolved Hide resolved
pkg/nsx/services/firewall.go Show resolved Hide resolved
pkg/nsx/services/firewall.go Outdated Show resolved Hide resolved
1.Support MatchExpression Operator: 'NotIn', 'Exists',
'DoesNotExist' for VM/Pod/Namespace label selectors
in SecurityPolicy

2.Given NSX doesn't support MatchExpression Operator 'In',
and only five criteria are allowed currently,
which results into a gigantic group expression body to be passed to NSX.
So, only allow just one Operator 'In' MatchExpressions with at most
of five values in it.

3.Add NSX-T limitation and NSGroup Criteria check
@timdengyun timdengyun force-pushed the AddMatchExpressionSupport branch from 3f6eb15 to a99a9b7 Compare January 29, 2022 09:21
@timdengyun timdengyun requested a review from heypnus January 29, 2022 09:21
@timdengyun timdengyun force-pushed the AddMatchExpressionSupport branch from a99a9b7 to c6fb922 Compare January 29, 2022 09:30
@timdengyun timdengyun merged commit 545bdb6 into vmware-tanzu:main Jan 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants