Skip to content

Commit 1e06b6e

Browse files
committed
provider/azure: Fix load balancer distribution constants
Signed-off-by: Stephen Augustus <[email protected]>
1 parent 77a4104 commit 1e06b6e

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

staging/src/k8s.io/legacy-cloud-providers/azure/azure_loadbalancer.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,9 +1005,9 @@ func (az *Cloud) reconcileLoadBalancerRule(
10051005
})
10061006
}
10071007

1008-
loadDistribution := network.Default
1008+
loadDistribution := network.LoadDistributionDefault
10091009
if service.Spec.SessionAffinity == v1.ServiceAffinityClientIP {
1010-
loadDistribution = network.SourceIP
1010+
loadDistribution = network.LoadDistributionSourceIP
10111011
}
10121012

10131013
expectedRule := network.LoadBalancingRule{

staging/src/k8s.io/legacy-cloud-providers/azure/azure_loadbalancer_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,14 +176,14 @@ func TestFindRule(t *testing.T) {
176176
{
177177
Name: to.StringPtr("probe1"),
178178
LoadBalancingRulePropertiesFormat: &network.LoadBalancingRulePropertiesFormat{
179-
LoadDistribution: network.SourceIP,
179+
LoadDistribution: network.LoadDistributionSourceIP,
180180
},
181181
},
182182
},
183183
curRule: network.LoadBalancingRule{
184184
Name: to.StringPtr("probe2"),
185185
LoadBalancingRulePropertiesFormat: &network.LoadBalancingRulePropertiesFormat{
186-
LoadDistribution: network.SourceIP,
186+
LoadDistribution: network.LoadDistributionSourceIP,
187187
},
188188
},
189189
expected: false,
@@ -196,7 +196,7 @@ func TestFindRule(t *testing.T) {
196196
LoadBalancingRulePropertiesFormat: &network.LoadBalancingRulePropertiesFormat{
197197
BackendPort: to.Int32Ptr(2),
198198
FrontendPort: to.Int32Ptr(2),
199-
LoadDistribution: network.SourceIP,
199+
LoadDistribution: network.LoadDistributionSourceIP,
200200
},
201201
},
202202
},
@@ -205,7 +205,7 @@ func TestFindRule(t *testing.T) {
205205
LoadBalancingRulePropertiesFormat: &network.LoadBalancingRulePropertiesFormat{
206206
BackendPort: to.Int32Ptr(2),
207207
FrontendPort: to.Int32Ptr(2),
208-
LoadDistribution: network.SourceIP,
208+
LoadDistribution: network.LoadDistributionSourceIP,
209209
},
210210
},
211211
expected: true,

staging/src/k8s.io/legacy-cloud-providers/azure/azure_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@ func TestServiceDefaultsToNoSessionPersistence(t *testing.T) {
709709
t.Error(err)
710710
}
711711

712-
if lbRule.LoadDistribution != network.Default {
712+
if lbRule.LoadDistribution != network.LoadDistributionDefault {
713713
t.Errorf("Expected LB rule to have default load distribution but was %s", lbRule.LoadDistribution)
714714
}
715715
}
@@ -732,7 +732,7 @@ func TestServiceRespectsNoSessionAffinity(t *testing.T) {
732732
t.Error(err)
733733
}
734734

735-
if lbRule.LoadDistribution != network.Default {
735+
if lbRule.LoadDistribution != network.LoadDistributionDefault {
736736
t.Errorf("Expected LB rule to have default load distribution but was %s", lbRule.LoadDistribution)
737737
}
738738
}
@@ -755,7 +755,7 @@ func TestServiceRespectsClientIPSessionAffinity(t *testing.T) {
755755
t.Error(err)
756756
}
757757

758-
if lbRule.LoadDistribution != network.SourceIP {
758+
if lbRule.LoadDistribution != network.LoadDistributionSourceIP {
759759
t.Errorf("Expected LB rule to have SourceIP load distribution but was %s", lbRule.LoadDistribution)
760760
}
761761
}

0 commit comments

Comments
 (0)