Remove azure-load-balancer-disable-tcp-reset annotation

This commit is contained in:
Marc Power 2020-08-27 23:17:59 -07:00
parent 0f3262cddb
commit 9b42f12e4f
2 changed files with 11 additions and 12 deletions

View File

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

View File

@ -1048,9 +1048,10 @@ func TestReconcileLoadBalancerRule(t *testing.T) {
wantLb: false,
},
{
desc: "reconcileLoadBalancerRule shall return corresponding probe and lbRule(blb)",
service: getTestService("test1", v1.ProtocolTCP, map[string]string{"service.beta.kubernetes.io/azure-load-balancer-disable-tcp-reset": "true"}, false, 80),
wantLb: true,
desc: "reconcileLoadBalancerRule shall return corresponding probe and lbRule(blb)",
service: getTestService("test1", v1.ProtocolTCP, map[string]string{"service.beta.kubernetes.io/azure-load-balancer-disable-tcp-reset": "true"}, false, 80),
loadBalancerSku: "basic",
wantLb: true,
expectedProbes: []network.Probe{
{
Name: to.StringPtr("atest1-TCP-80"),
@ -1125,7 +1126,7 @@ func TestReconcileLoadBalancerRule(t *testing.T) {
ID: to.StringPtr("/subscriptions/subscription/resourceGroups/rg/providers/" +
"Microsoft.Network/loadBalancers/lbname/probes/atest1-TCP-80"),
},
EnableTCPReset: to.BoolPtr(false),
EnableTCPReset: to.BoolPtr(true),
},
},
},
@ -1351,7 +1352,7 @@ func TestReconcileLoadBalancer(t *testing.T) {
expectedSLb := getTestLoadBalancer(to.StringPtr("testCluster"), to.StringPtr("rg"), to.StringPtr("testCluster"), to.StringPtr("aservice1"), service4, "Standard")
(*expectedSLb.LoadBalancerPropertiesFormat.LoadBalancingRules)[0].DisableOutboundSnat = to.BoolPtr(true)
(*expectedSLb.LoadBalancerPropertiesFormat.LoadBalancingRules)[0].EnableTCPReset = to.BoolPtr(false)
(*expectedSLb.LoadBalancerPropertiesFormat.LoadBalancingRules)[0].EnableTCPReset = to.BoolPtr(true)
expectedSLb.FrontendIPConfigurations = &[]network.FrontendIPConfiguration{
{
Name: to.StringPtr("aservice1"),
@ -1400,7 +1401,7 @@ func TestReconcileLoadBalancer(t *testing.T) {
},
}
//change to false to test that reconciliation will fix it
//change to false to test that reconciliation will fix it (despite the fact that disable-tcp-reset was removed in 1.20)
(*slb5.LoadBalancerPropertiesFormat.LoadBalancingRules)[0].EnableTCPReset = to.BoolPtr(false)
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) {
expectedError: nil,
},
{
desc: "reconcileLoadBalancer shall remove and reconstruct the correspoind field of lb and set enableTcpReset to false in lbRule",
desc: "reconcileLoadBalancer shall remove and reconstruct the correspoind field of lb and set enableTcpReset to true in lbRule",
loadBalancerSku: "standard",
service: service4,
disableOutboundSnat: to.BoolPtr(true),
@ -1561,7 +1562,7 @@ func TestReconcileLoadBalancer(t *testing.T) {
expectedError: nil,
},
{
desc: "reconcileLoadBalancer shall remove and reconstruct the correspoind field of lb and set enableTcpReset to true in lbRule",
desc: "reconcileLoadBalancer shall remove and reconstruct the correspoind field of lb and set enableTcpReset (false => true) in lbRule",
loadBalancerSku: "standard",
service: service5,
disableOutboundSnat: to.BoolPtr(true),