Skip to content

Commit

Permalink
Add Ambassador Host Target namespace test
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleMartin901 committed Jun 7, 2022
1 parent aa37b6e commit 51e3633
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions source/ambassador_host_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,45 @@ func testAmbassadorSourceEndpoints(t *testing.T) {
},
},
},
{
title: "two simple hosts on different namespaces and a target namespace",
targetNamespace: "testing1",
labelSelector: labels.Everything(),
loadBalancer: fakeAmbassadorLoadBalancerService{
ips: []string{"8.8.8.8"},
hostnames: []string{"lb.com"},
name: "emissary",
namespace: "emissary-ingress",
},
ambassadorHostItems: []fakeAmbassadorHost{
{
name: "fake1",
namespace: "testing1",
hostname: "fake1.org",
annotations: map[string]string{
"external-dns.ambassador-service": "emissary-ingress/emissary",
},
},
{
name: "fake2",
namespace: "testing2",
hostname: "fake2.org",
annotations: map[string]string{
"external-dns.ambassador-service": "emissary-ingress/emissary",
},
},
},
expected: []*endpoint.Endpoint{
{
DNSName: "fake1.org",
Targets: endpoint.Targets{"8.8.8.8"},
},
{
DNSName: "fake1.org",
Targets: endpoint.Targets{"lb.com"},
},
},
},
{
title: "invalid non matching host ambassador service annotation",
targetNamespace: "",
Expand Down

0 comments on commit 51e3633

Please sign in to comment.