Updating kube-proxy to trim space from loadBalancerSourceRanges

Before this fix, a Service with a loadBalancerSourceRange value that
included a space would cause kube-proxy to crashloop. This updates
kube-proxy to trim any space from that field.
This commit is contained in:
Rob Scott
2020-08-19 12:30:49 -07:00
parent 544b74c2cb
commit c382c79f60
4 changed files with 60 additions and 23 deletions

View File

@@ -687,6 +687,10 @@ func TestLoadBalancer(t *testing.T) {
svc.Status.LoadBalancer.Ingress = []v1.LoadBalancerIngress{{
IP: svcLBIP,
}}
// Also ensure that invalid LoadBalancerSourceRanges will not result
// in a crash.
svc.Spec.ExternalIPs = []string{svcLBIP}
svc.Spec.LoadBalancerSourceRanges = []string{" 1.2.3.4/28"}
}),
)