mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
Merge pull request #85990 from feiskyer/fix-85989
Fix LoadBalancer rule checking so that no unexpected LoadBalancer updates are made
This commit is contained in:
commit
b5040be796
@ -1641,7 +1641,7 @@ func equalLoadBalancingRulePropertiesFormat(s *network.LoadBalancingRuleProperti
|
||||
reflect.DeepEqual(s.EnableTCPReset, t.EnableTCPReset) &&
|
||||
reflect.DeepEqual(s.DisableOutboundSnat, t.DisableOutboundSnat)
|
||||
|
||||
if wantLB {
|
||||
if wantLB && s.IdleTimeoutInMinutes != nil && t.IdleTimeoutInMinutes != nil {
|
||||
return properties && reflect.DeepEqual(s.IdleTimeoutInMinutes, t.IdleTimeoutInMinutes)
|
||||
}
|
||||
return properties
|
||||
|
@ -173,6 +173,40 @@ func TestFindRule(t *testing.T) {
|
||||
},
|
||||
expected: false,
|
||||
},
|
||||
{
|
||||
msg: "rule names match while idletimeout unmatch should return false",
|
||||
existingRule: []network.LoadBalancingRule{
|
||||
{
|
||||
Name: to.StringPtr("httpRule"),
|
||||
LoadBalancingRulePropertiesFormat: &network.LoadBalancingRulePropertiesFormat{
|
||||
IdleTimeoutInMinutes: to.Int32Ptr(1),
|
||||
},
|
||||
},
|
||||
},
|
||||
curRule: network.LoadBalancingRule{
|
||||
Name: to.StringPtr("httpRule"),
|
||||
LoadBalancingRulePropertiesFormat: &network.LoadBalancingRulePropertiesFormat{
|
||||
IdleTimeoutInMinutes: to.Int32Ptr(2),
|
||||
},
|
||||
},
|
||||
expected: false,
|
||||
},
|
||||
{
|
||||
msg: "rule names match while idletimeout nil should return true",
|
||||
existingRule: []network.LoadBalancingRule{
|
||||
{
|
||||
Name: to.StringPtr("httpRule"),
|
||||
LoadBalancingRulePropertiesFormat: &network.LoadBalancingRulePropertiesFormat{},
|
||||
},
|
||||
},
|
||||
curRule: network.LoadBalancingRule{
|
||||
Name: to.StringPtr("httpRule"),
|
||||
LoadBalancingRulePropertiesFormat: &network.LoadBalancingRulePropertiesFormat{
|
||||
IdleTimeoutInMinutes: to.Int32Ptr(2),
|
||||
},
|
||||
},
|
||||
expected: true,
|
||||
},
|
||||
{
|
||||
msg: "rule names match while LoadDistribution unmatch should return false",
|
||||
existingRule: []network.LoadBalancingRule{
|
||||
|
Loading…
Reference in New Issue
Block a user