Skip to content

Commit 9b42f12

Browse files
committed
Remove azure-load-balancer-disable-tcp-reset annotation
1 parent 0f3262c commit 9b42f12

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
@@ -1007,10 +1007,8 @@ func (az *Cloud) reconcileLoadBalancerRule(
10071007
var enableTCPReset *bool
10081008
if az.useStandardLoadBalancer() {
10091009
enableTCPReset = to.BoolPtr(true)
1010-
if v, ok := service.Annotations[ServiceAnnotationLoadBalancerDisableTCPReset]; ok {
1011-
klog.Warning("annotation service.beta.kubernetes.io/azure-load-balancer-disable-tcp-reset has been depracated, it would be removed in a future release")
1012-
klog.V(2).Infof("reconcileLoadBalancerRule lb name (%s) flag(%s) is set to %s", lbName, ServiceAnnotationLoadBalancerDisableTCPReset, v)
1013-
enableTCPReset = to.BoolPtr(!strings.EqualFold(v, "true"))
1010+
if _, ok := service.Annotations[ServiceAnnotationLoadBalancerDisableTCPReset]; ok {
1011+
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.")
10141012
}
10151013
}
10161014

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
@@ -1048,9 +1048,10 @@ func TestReconcileLoadBalancerRule(t *testing.T) {
10481048
wantLb: false,
10491049
},
10501050
{
1051-
desc: "reconcileLoadBalancerRule shall return corresponding probe and lbRule(blb)",
1052-
service: getTestService("test1", v1.ProtocolTCP, map[string]string{"service.beta.kubernetes.io/azure-load-balancer-disable-tcp-reset": "true"}, false, 80),
1053-
wantLb: true,
1051+
desc: "reconcileLoadBalancerRule shall return corresponding probe and lbRule(blb)",
1052+
service: getTestService("test1", v1.ProtocolTCP, map[string]string{"service.beta.kubernetes.io/azure-load-balancer-disable-tcp-reset": "true"}, false, 80),
1053+
loadBalancerSku: "basic",
1054+
wantLb: true,
10541055
expectedProbes: []network.Probe{
10551056
{
10561057
Name: to.StringPtr("atest1-TCP-80"),
@@ -1125,7 +1126,7 @@ func TestReconcileLoadBalancerRule(t *testing.T) {
11251126
ID: to.StringPtr("/subscriptions/subscription/resourceGroups/rg/providers/" +
11261127
"Microsoft.Network/loadBalancers/lbname/probes/atest1-TCP-80"),
11271128
},
1128-
EnableTCPReset: to.BoolPtr(false),
1129+
EnableTCPReset: to.BoolPtr(true),
11291130
},
11301131
},
11311132
},
@@ -1351,7 +1352,7 @@ func TestReconcileLoadBalancer(t *testing.T) {
13511352

13521353
expectedSLb := getTestLoadBalancer(to.StringPtr("testCluster"), to.StringPtr("rg"), to.StringPtr("testCluster"), to.StringPtr("aservice1"), service4, "Standard")
13531354
(*expectedSLb.LoadBalancerPropertiesFormat.LoadBalancingRules)[0].DisableOutboundSnat = to.BoolPtr(true)
1354-
(*expectedSLb.LoadBalancerPropertiesFormat.LoadBalancingRules)[0].EnableTCPReset = to.BoolPtr(false)
1355+
(*expectedSLb.LoadBalancerPropertiesFormat.LoadBalancingRules)[0].EnableTCPReset = to.BoolPtr(true)
13551356
expectedSLb.FrontendIPConfigurations = &[]network.FrontendIPConfiguration{
13561357
{
13571358
Name: to.StringPtr("aservice1"),
@@ -1400,7 +1401,7 @@ func TestReconcileLoadBalancer(t *testing.T) {
14001401
},
14011402
}
14021403

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

14061407
expectedSLb5 := getTestLoadBalancer(to.StringPtr("testCluster"), to.StringPtr("rg"), to.StringPtr("testCluster"), to.StringPtr("aservice1"), service5, "Standard")
@@ -1551,7 +1552,7 @@ func TestReconcileLoadBalancer(t *testing.T) {
15511552
expectedError: nil,
15521553
},
15531554
{
1554-
desc: "reconcileLoadBalancer shall remove and reconstruct the correspoind field of lb and set enableTcpReset to false in lbRule",
1555+
desc: "reconcileLoadBalancer shall remove and reconstruct the correspoind field of lb and set enableTcpReset to true in lbRule",
15551556
loadBalancerSku: "standard",
15561557
service: service4,
15571558
disableOutboundSnat: to.BoolPtr(true),
@@ -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 true in lbRule",
1565+
desc: "reconcileLoadBalancer shall remove and reconstruct the correspoind field of lb and set enableTcpReset (false => true) in lbRule",
15651566
loadBalancerSku: "standard",
15661567
service: service5,
15671568
disableOutboundSnat: to.BoolPtr(true),

0 commit comments

Comments
 (0)