mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
provider/azure: Fix load balancer distribution constants
Signed-off-by: Stephen Augustus <saugustus@vmware.com>
This commit is contained in:
parent
77a41043a5
commit
1e06b6ecad
@ -1005,9 +1005,9 @@ func (az *Cloud) reconcileLoadBalancerRule(
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
loadDistribution := network.Default
|
loadDistribution := network.LoadDistributionDefault
|
||||||
if service.Spec.SessionAffinity == v1.ServiceAffinityClientIP {
|
if service.Spec.SessionAffinity == v1.ServiceAffinityClientIP {
|
||||||
loadDistribution = network.SourceIP
|
loadDistribution = network.LoadDistributionSourceIP
|
||||||
}
|
}
|
||||||
|
|
||||||
expectedRule := network.LoadBalancingRule{
|
expectedRule := network.LoadBalancingRule{
|
||||||
|
@ -176,14 +176,14 @@ func TestFindRule(t *testing.T) {
|
|||||||
{
|
{
|
||||||
Name: to.StringPtr("probe1"),
|
Name: to.StringPtr("probe1"),
|
||||||
LoadBalancingRulePropertiesFormat: &network.LoadBalancingRulePropertiesFormat{
|
LoadBalancingRulePropertiesFormat: &network.LoadBalancingRulePropertiesFormat{
|
||||||
LoadDistribution: network.SourceIP,
|
LoadDistribution: network.LoadDistributionSourceIP,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
curRule: network.LoadBalancingRule{
|
curRule: network.LoadBalancingRule{
|
||||||
Name: to.StringPtr("probe2"),
|
Name: to.StringPtr("probe2"),
|
||||||
LoadBalancingRulePropertiesFormat: &network.LoadBalancingRulePropertiesFormat{
|
LoadBalancingRulePropertiesFormat: &network.LoadBalancingRulePropertiesFormat{
|
||||||
LoadDistribution: network.SourceIP,
|
LoadDistribution: network.LoadDistributionSourceIP,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
expected: false,
|
expected: false,
|
||||||
@ -196,7 +196,7 @@ func TestFindRule(t *testing.T) {
|
|||||||
LoadBalancingRulePropertiesFormat: &network.LoadBalancingRulePropertiesFormat{
|
LoadBalancingRulePropertiesFormat: &network.LoadBalancingRulePropertiesFormat{
|
||||||
BackendPort: to.Int32Ptr(2),
|
BackendPort: to.Int32Ptr(2),
|
||||||
FrontendPort: to.Int32Ptr(2),
|
FrontendPort: to.Int32Ptr(2),
|
||||||
LoadDistribution: network.SourceIP,
|
LoadDistribution: network.LoadDistributionSourceIP,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -205,7 +205,7 @@ func TestFindRule(t *testing.T) {
|
|||||||
LoadBalancingRulePropertiesFormat: &network.LoadBalancingRulePropertiesFormat{
|
LoadBalancingRulePropertiesFormat: &network.LoadBalancingRulePropertiesFormat{
|
||||||
BackendPort: to.Int32Ptr(2),
|
BackendPort: to.Int32Ptr(2),
|
||||||
FrontendPort: to.Int32Ptr(2),
|
FrontendPort: to.Int32Ptr(2),
|
||||||
LoadDistribution: network.SourceIP,
|
LoadDistribution: network.LoadDistributionSourceIP,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
expected: true,
|
expected: true,
|
||||||
|
@ -709,7 +709,7 @@ func TestServiceDefaultsToNoSessionPersistence(t *testing.T) {
|
|||||||
t.Error(err)
|
t.Error(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if lbRule.LoadDistribution != network.Default {
|
if lbRule.LoadDistribution != network.LoadDistributionDefault {
|
||||||
t.Errorf("Expected LB rule to have default load distribution but was %s", lbRule.LoadDistribution)
|
t.Errorf("Expected LB rule to have default load distribution but was %s", lbRule.LoadDistribution)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -732,7 +732,7 @@ func TestServiceRespectsNoSessionAffinity(t *testing.T) {
|
|||||||
t.Error(err)
|
t.Error(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if lbRule.LoadDistribution != network.Default {
|
if lbRule.LoadDistribution != network.LoadDistributionDefault {
|
||||||
t.Errorf("Expected LB rule to have default load distribution but was %s", lbRule.LoadDistribution)
|
t.Errorf("Expected LB rule to have default load distribution but was %s", lbRule.LoadDistribution)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -755,7 +755,7 @@ func TestServiceRespectsClientIPSessionAffinity(t *testing.T) {
|
|||||||
t.Error(err)
|
t.Error(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if lbRule.LoadDistribution != network.SourceIP {
|
if lbRule.LoadDistribution != network.LoadDistributionSourceIP {
|
||||||
t.Errorf("Expected LB rule to have SourceIP load distribution but was %s", lbRule.LoadDistribution)
|
t.Errorf("Expected LB rule to have SourceIP load distribution but was %s", lbRule.LoadDistribution)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user