Skip to content

Commit 35e235b

Browse files
authored
Merge pull request kubernetes#94297 from MarcPow/remove-service-annotation-disable-tcp-reset
Remove azure-load-balancer-disable-tcp-reset annotation
2 parents 01e9dda + 9b42f12 commit 35e235b

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,10 +1025,8 @@ func (az *Cloud) reconcileLoadBalancerRule(
10251025
var enableTCPReset *bool
10261026
if az.useStandardLoadBalancer() {
10271027
enableTCPReset = to.BoolPtr(true)
1028-
if v, ok := service.Annotations[ServiceAnnotationLoadBalancerDisableTCPReset]; ok {
1029-
klog.Warning("annotation service.beta.kubernetes.io/azure-load-balancer-disable-tcp-reset has been depracated, it would be removed in a future release")
1030-
klog.V(2).Infof("reconcileLoadBalancerRule lb name (%s) flag(%s) is set to %s", lbName, ServiceAnnotationLoadBalancerDisableTCPReset, v)
1031-
enableTCPReset = to.BoolPtr(!strings.EqualFold(v, "true"))
1028+
if _, ok := service.Annotations[ServiceAnnotationLoadBalancerDisableTCPReset]; ok {
1029+
klog.Warning("annotation service.beta.kubernetes.io/azure-load-balancer-disable-tcp-reset has been removed as of Kubernetes 1.20. TCP Resets are always enabled on Standard SKU load balancers.")
10321030
}
10331031
}
10341032

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

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,9 +1058,10 @@ func TestReconcileLoadBalancerRule(t *testing.T) {
10581058
wantLb: false,
10591059
},
10601060
{
1061-
desc: "reconcileLoadBalancerRule shall return corresponding probe and lbRule(blb)",
1062-
service: getTestService("test1", v1.ProtocolTCP, map[string]string{"service.beta.kubernetes.io/azure-load-balancer-disable-tcp-reset": "true"}, false, 80),
1063-
wantLb: true,
1061+
desc: "reconcileLoadBalancerRule shall return corresponding probe and lbRule(blb)",
1062+
service: getTestService("test1", v1.ProtocolTCP, map[string]string{"service.beta.kubernetes.io/azure-load-balancer-disable-tcp-reset": "true"}, false, 80),
1063+
loadBalancerSku: "basic",
1064+
wantLb: true,
10641065
expectedProbes: []network.Probe{
10651066
{
10661067
Name: to.StringPtr("atest1-TCP-80"),
@@ -1135,7 +1136,7 @@ func TestReconcileLoadBalancerRule(t *testing.T) {
11351136
ID: to.StringPtr("/subscriptions/subscription/resourceGroups/rg/providers/" +
11361137
"Microsoft.Network/loadBalancers/lbname/probes/atest1-TCP-80"),
11371138
},
1138-
EnableTCPReset: to.BoolPtr(false),
1139+
EnableTCPReset: to.BoolPtr(true),
11391140
},
11401141
},
11411142
},
@@ -1361,7 +1362,7 @@ func TestReconcileLoadBalancer(t *testing.T) {
13611362

13621363
expectedSLb := getTestLoadBalancer(to.StringPtr("testCluster"), to.StringPtr("rg"), to.StringPtr("testCluster"), to.StringPtr("aservice1"), service4, "Standard")
13631364
(*expectedSLb.LoadBalancerPropertiesFormat.LoadBalancingRules)[0].DisableOutboundSnat = to.BoolPtr(true)
1364-
(*expectedSLb.LoadBalancerPropertiesFormat.LoadBalancingRules)[0].EnableTCPReset = to.BoolPtr(false)
1365+
(*expectedSLb.LoadBalancerPropertiesFormat.LoadBalancingRules)[0].EnableTCPReset = to.BoolPtr(true)
13651366
expectedSLb.FrontendIPConfigurations = &[]network.FrontendIPConfiguration{
13661367
{
13671368
Name: to.StringPtr("aservice1"),
@@ -1410,7 +1411,7 @@ func TestReconcileLoadBalancer(t *testing.T) {
14101411
},
14111412
}
14121413

1413-
//change to false to test that reconciliation will fix it
1414+
//change to false to test that reconciliation will fix it (despite the fact that disable-tcp-reset was removed in 1.20)
14141415
(*slb5.LoadBalancerPropertiesFormat.LoadBalancingRules)[0].EnableTCPReset = to.BoolPtr(false)
14151416

14161417
expectedSLb5 := getTestLoadBalancer(to.StringPtr("testCluster"), to.StringPtr("rg"), to.StringPtr("testCluster"), to.StringPtr("aservice1"), service5, "Standard")
@@ -1561,7 +1562,7 @@ func TestReconcileLoadBalancer(t *testing.T) {
15611562
expectedError: nil,
15621563
},
15631564
{
1564-
desc: "reconcileLoadBalancer shall remove and reconstruct the correspoind field of lb and set enableTcpReset to false in lbRule",
1565+
desc: "reconcileLoadBalancer shall remove and reconstruct the correspoind field of lb and set enableTcpReset to true in lbRule",
15651566
loadBalancerSku: "standard",
15661567
service: service4,
15671568
disableOutboundSnat: to.BoolPtr(true),
@@ -1571,7 +1572,7 @@ func TestReconcileLoadBalancer(t *testing.T) {
15711572
expectedError: nil,
15721573
},
15731574
{
1574-
desc: "reconcileLoadBalancer shall remove and reconstruct the correspoind field of lb and set enableTcpReset to true in lbRule",
1575+
desc: "reconcileLoadBalancer shall remove and reconstruct the correspoind field of lb and set enableTcpReset (false => true) in lbRule",
15751576
loadBalancerSku: "standard",
15761577
service: service5,
15771578
disableOutboundSnat: to.BoolPtr(true),

0 commit comments

Comments
 (0)