Populate endpoints and allow ports with headless service
This commit is contained in:
@@ -57,13 +57,6 @@ func TestServiceBasicGenerate(t *testing.T) {
|
||||
serviceType: api.ServiceTypeClusterIP,
|
||||
expectErr: true,
|
||||
},
|
||||
{
|
||||
name: "clusterip-none and port mapping",
|
||||
tcp: []string{"456:9898"},
|
||||
clusterip: "None",
|
||||
serviceType: api.ServiceTypeClusterIP,
|
||||
expectErr: true,
|
||||
},
|
||||
{
|
||||
name: "clusterip-none-wrong-type",
|
||||
tcp: []string{},
|
||||
@@ -88,6 +81,23 @@ func TestServiceBasicGenerate(t *testing.T) {
|
||||
},
|
||||
expectErr: false,
|
||||
},
|
||||
{
|
||||
name: "clusterip-none-and-port-mapping",
|
||||
tcp: []string{"456:9898"},
|
||||
clusterip: "None",
|
||||
serviceType: api.ServiceTypeClusterIP,
|
||||
expected: &api.Service{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "clusterip-none-and-port-mapping",
|
||||
Labels: map[string]string{"app": "clusterip-none-and-port-mapping"},
|
||||
},
|
||||
Spec: api.ServiceSpec{Type: "ClusterIP",
|
||||
Ports: []api.ServicePort{{Name: "456-9898", Protocol: "TCP", Port: 456, TargetPort: intstr.IntOrString{Type: 0, IntVal: 9898, StrVal: ""}, NodePort: 0}},
|
||||
Selector: map[string]string{"app": "clusterip-none-and-port-mapping"},
|
||||
ClusterIP: "None", ExternalIPs: []string(nil), LoadBalancerIP: ""},
|
||||
},
|
||||
expectErr: false,
|
||||
},
|
||||
{
|
||||
name: "loadbalancer-ok",
|
||||
tcp: []string{"456:9898"},
|
||||
|
Reference in New Issue
Block a user