Merge pull request #42998 from derekwaynecarr/quota-test

Automatic merge from submit-queue

Unit test quota for nodeport associated with loadbalancer

**What this PR does / why we need it**:
This PR adds unit tests to ensure node ports associated with loadbalancers are charged to quota appropriately.  The original PR that added that feature to quota lacked a unit test (https://github.com/kubernetes/kubernetes/pull/39364)
This commit is contained in:
Kubernetes Submit Queue 2017-03-25 16:41:50 -07:00 committed by GitHub
commit 1db60e5d55

View File

@ -67,6 +67,23 @@ func TestServiceEvaluatorUsage(t *testing.T) {
api.ResourceServices: resource.MustParse("1"),
},
},
"loadbalancer_ports": {
service: &api.Service{
Spec: api.ServiceSpec{
Type: api.ServiceTypeLoadBalancer,
Ports: []api.ServicePort{
{
Port: 27443,
},
},
},
},
usage: api.ResourceList{
api.ResourceServicesNodePorts: resource.MustParse("1"),
api.ResourceServicesLoadBalancers: resource.MustParse("1"),
api.ResourceServices: resource.MustParse("1"),
},
},
"clusterip": {
service: &api.Service{
Spec: api.ServiceSpec{