Remove localhost calls from external names
Signed-off-by: Ricardo Pchevuzinske Katz <ricardo.katz@gmail.com>
This commit is contained in:
parent
22ae0d3848
commit
0dceedfad7
6 changed files with 74 additions and 1 deletions
|
|
@ -78,6 +78,54 @@ func TestGetEndpoints(t *testing.T) {
|
|||
},
|
||||
[]ingress.Endpoint{},
|
||||
},
|
||||
{
|
||||
"a service type ServiceTypeExternalName service with localhost in name should return 0 endpoint",
|
||||
&corev1.Service{
|
||||
Spec: corev1.ServiceSpec{
|
||||
Type: corev1.ServiceTypeExternalName,
|
||||
ExternalName: "localhost",
|
||||
Ports: []corev1.ServicePort{
|
||||
{
|
||||
Name: "default",
|
||||
TargetPort: intstr.FromInt(443),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
&corev1.ServicePort{
|
||||
Name: "default",
|
||||
TargetPort: intstr.FromInt(80),
|
||||
},
|
||||
corev1.ProtocolTCP,
|
||||
func(string) (*corev1.Endpoints, error) {
|
||||
return &corev1.Endpoints{}, nil
|
||||
},
|
||||
[]ingress.Endpoint{},
|
||||
},
|
||||
{
|
||||
"a service type ServiceTypeExternalName service with 127.0.0.1 in name should return 0 endpoint",
|
||||
&corev1.Service{
|
||||
Spec: corev1.ServiceSpec{
|
||||
Type: corev1.ServiceTypeExternalName,
|
||||
ExternalName: "127.0.0.1",
|
||||
Ports: []corev1.ServicePort{
|
||||
{
|
||||
Name: "default",
|
||||
TargetPort: intstr.FromInt(443),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
&corev1.ServicePort{
|
||||
Name: "default",
|
||||
TargetPort: intstr.FromInt(80),
|
||||
},
|
||||
corev1.ProtocolTCP,
|
||||
func(string) (*corev1.Endpoints, error) {
|
||||
return &corev1.Endpoints{}, nil
|
||||
},
|
||||
[]ingress.Endpoint{},
|
||||
},
|
||||
{
|
||||
"a service type ServiceTypeExternalName with a valid port should return one endpoint",
|
||||
&corev1.Service{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue