mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-05 18:24:07 +00:00
comment on findSecurityRule and fmt
This commit is contained in:
parent
d39b517ad3
commit
8514537759
@ -1205,6 +1205,10 @@ func findRule(rules []network.LoadBalancingRule, rule network.LoadBalancingRule)
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This compares rule's Name, Protocol, SourcePortRange, DestinationPortRange, SourceAddressPrefix, Access, and Direction.
|
||||||
|
// Note that it compares rule's DestinationAddressPrefix only when it's not consolidated rule as such rule does not have DestinationAddressPrefix defined.
|
||||||
|
// We intentionally do not compare DestinationAddressPrefixes in consolidated case because reconcileSecurityRule has to consider the two rules equal,
|
||||||
|
// despite different DestinationAddressPrefixes, in order to give it a chance to consolidate the two rules.
|
||||||
func findSecurityRule(rules []network.SecurityRule, rule network.SecurityRule) bool {
|
func findSecurityRule(rules []network.SecurityRule, rule network.SecurityRule) bool {
|
||||||
for _, existingRule := range rules {
|
for _, existingRule := range rules {
|
||||||
if !strings.EqualFold(*existingRule.Name, *rule.Name) {
|
if !strings.EqualFold(*existingRule.Name, *rule.Name) {
|
||||||
|
Loading…
Reference in New Issue
Block a user