remove unused functions (#2873)
This commit is contained in:
parent
458e778113
commit
bd83f74deb
2 changed files with 0 additions and 97 deletions
|
@ -355,73 +355,3 @@ func TestServicesAuthority(t *testing.T) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestServiceFQDN(t *testing.T) {
|
||||
fqdn := serviceFQDN(
|
||||
&object.Service{
|
||||
Name: "svc1",
|
||||
Namespace: "testns",
|
||||
}, "cluster.local")
|
||||
|
||||
expected := "svc1.testns.svc.cluster.local."
|
||||
if fqdn != expected {
|
||||
t.Errorf("Expected '%v', got '%v'.", expected, fqdn)
|
||||
}
|
||||
}
|
||||
|
||||
func TestPodFQDN(t *testing.T) {
|
||||
fqdn := podFQDN(
|
||||
&object.Pod{
|
||||
Name: "pod1",
|
||||
Namespace: "testns",
|
||||
PodIP: "10.10.0.10",
|
||||
}, "cluster.local")
|
||||
|
||||
expected := "10-10-0-10.testns.pod.cluster.local."
|
||||
if fqdn != expected {
|
||||
t.Errorf("Expected '%v', got '%v'.", expected, fqdn)
|
||||
}
|
||||
fqdn = podFQDN(
|
||||
&object.Pod{
|
||||
Name: "pod1",
|
||||
Namespace: "testns",
|
||||
PodIP: "aaaa:bbbb:cccc::zzzz",
|
||||
}, "cluster.local")
|
||||
|
||||
expected = "aaaa-bbbb-cccc--zzzz.testns.pod.cluster.local."
|
||||
if fqdn != expected {
|
||||
t.Errorf("Expected '%v', got '%v'.", expected, fqdn)
|
||||
}
|
||||
}
|
||||
|
||||
func TestEndpointFQDN(t *testing.T) {
|
||||
fqdns := endpointFQDN(
|
||||
&object.Endpoints{
|
||||
Subsets: []object.EndpointSubset{
|
||||
{
|
||||
Addresses: []object.EndpointAddress{
|
||||
{
|
||||
IP: "172.0.0.1",
|
||||
Hostname: "ep1a",
|
||||
},
|
||||
{
|
||||
IP: "172.0.0.2",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
Name: "svc1",
|
||||
Namespace: "testns",
|
||||
}, "cluster.local", false)
|
||||
|
||||
expected := []string{
|
||||
"ep1a.svc1.testns.svc.cluster.local.",
|
||||
"172-0-0-2.svc1.testns.svc.cluster.local.",
|
||||
}
|
||||
|
||||
for i := range fqdns {
|
||||
if fqdns[i] != expected[i] {
|
||||
t.Errorf("Expected '%v', got '%v'.", expected[i], fqdns[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue