disallow user to update loadbalancerSourceRanges

This commit is contained in:
Minhan Xia
2016-09-22 17:41:25 -07:00
parent 87b40782c9
commit ba45a3f74e
2 changed files with 22 additions and 0 deletions

View File

@@ -6388,6 +6388,25 @@ func TestValidateServiceUpdate(t *testing.T) {
},
numErrs: 0,
},
{
name: "add loadBalancerSourceRanges",
tweakSvc: func(oldSvc, newSvc *api.Service) {
oldSvc.Spec.Type = api.ServiceTypeLoadBalancer
newSvc.Spec.Type = api.ServiceTypeLoadBalancer
newSvc.Spec.LoadBalancerSourceRanges = []string{"10.0.0.0/8"}
},
numErrs: 1,
},
{
name: "update loadBalancerSourceRanges",
tweakSvc: func(oldSvc, newSvc *api.Service) {
oldSvc.Spec.Type = api.ServiceTypeLoadBalancer
oldSvc.Spec.LoadBalancerSourceRanges = []string{"10.0.0.0/8"}
newSvc.Spec.Type = api.ServiceTypeLoadBalancer
newSvc.Spec.LoadBalancerSourceRanges = []string{"10.180.0.0/16"}
},
numErrs: 1,
},
}
for _, tc := range testCases {