-
Notifications
You must be signed in to change notification settings - Fork 360
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
refactor: group xds security features for security policy #3019
Conversation
Signed-off-by: shawnh2 <shawnhxh@outlook.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3019 +/- ##
==========================================
- Coverage 66.51% 64.41% -2.10%
==========================================
Files 161 121 -40
Lines 22673 21428 -1245
==========================================
- Hits 15080 13802 -1278
- Misses 6720 6759 +39
+ Partials 873 867 -6 ☔ View full report in Codecov by Sentry. |
/retest |
1 similar comment
/retest |
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.
Thanks for the refactoring. This looks good, just a few nits.
Signed-off-by: shawnh2 <shawnhxh@outlook.com>
/retest |
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!
Signed-off-by: shawnh2 <shawnhxh@outlook.com>
/retest |
@shawnh2 Apologies for the delay on this PR. Can you fix the conflicts so we can move on? |
Signed-off-by: shawnh2 <shawnhxh@outlook.com>
Signed-off-by: shawnh2 <shawnhxh@outlook.com>
Resolved, thanks for reviewing this. |
/retest |
TestE2E/GatewayInfraResourceTest/create_gateway seems a liitle unstable. |
/retest |
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!
return true | ||
} | ||
|
||
return s.CORS == nil && |
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.
will we ever hit this case ? where s != nil, but all sub fields are nil ?
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.
we may very unlikely to hit the case that all fields are nil, but we may hit the case that only some (if any) of the fields are set, indicates s
is not Empty, return false. This is exactly what we used for this method, as you can see in translateSecurityPolicyForGateway
method.
I took the @zhaohuabing's suggestion, make this method called Empty
, instead of Any
(or other name), so it will be very comprehensible for anyone who read it.
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.
non blocking comment - I personally feel this is not needed, and s != nil
is enough w/o the need for a Empty
func
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.
I will try this out, if it's working w/o Empty method, I will refactor this in the follow-up PR along with the refactor of BTP.
this looks good @shawnh2 ! sorry for the delay in reviewing it |
What type of PR is this?
What this PR does / why we need it:
Which issue(s) this PR fixes:
related: #2954, separated from #2926