-
Notifications
You must be signed in to change notification settings - Fork 435
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
✨ Allow more permissive extensibility for securityRules #5525
base: main
Are you sure you want to change the base?
✨ Allow more permissive extensibility for securityRules #5525
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5525 +/- ##
=======================================
Coverage 52.61% 52.61%
=======================================
Files 272 272
Lines 29485 29507 +22
=======================================
+ Hits 15513 15526 +13
- Misses 13165 13174 +9
Partials 807 807 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Danil-Grigorev <[email protected]>
bec7326
to
fbe11d7
Compare
@@ -893,6 +893,20 @@ func (s SubnetSpec) IsIPv6Enabled() bool { | |||
return false | |||
} | |||
|
|||
// GetSecurityRuleByDestination returns security group rule, which matches provided destination ports. | |||
func (s SubnetSpec) GetSecurityRuleByDestination(ports string) *SecurityRule { | |||
if s.SecurityGroup.SecurityRules == 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.
wrapping the below for loop in if s.SecurityGroup.SecurityRules != nil {
is equivalent and allows us to remove the add'l return nil
response (we don't need a specific nil
return for this condition because the default return before exiting the function is nil
)
@@ -1020,9 +1020,18 @@ func (s *ClusterScope) SetControlPlaneSecurityRules() { | |||
if !s.ControlPlaneEnabled() { | |||
return | |||
} | |||
if s.ControlPlaneSubnet().SecurityGroup.SecurityRules == nil { | |||
|
|||
subnet := s.ControlPlaneSubnet() |
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.
in this flow where are we adding any user-provided security rules? (for example if a user specifies TCP 9345
)
or is that elsewhere and the purpose of this change is to filter out 22
and apiserver port if it's not included?
What type of PR is this?
/kind feature
What this PR does / why we need it:
This change improves UX while using
CAPZ
withRKE2
provider, by allowing to specify only additional security rules on theAzureCluster
resource, and making existing security rule defaults forAPIServer
andSSH
port more permissive and based on destination port selection.Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #5511
Special notes for your reviewer:
TODOs:
Release note: