Skip to content

Commit

Permalink
chore(source): add test for annotation taking precendence over templa…
Browse files Browse the repository at this point in the history
…te (#257)
  • Loading branch information
linki authored and hjacobs committed Jul 3, 2017
1 parent 81974cd commit 4d48cef
Showing 1 changed file with 24 additions and 6 deletions.
30 changes: 24 additions & 6 deletions source/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,17 +344,22 @@ func testServiceSourceEndpoints(t *testing.T) {
false,
},
{
"not annotated services with unknown tmpl field should not return anything",
"annotated services with set fqdnTemplate annotation takes precedence",
"",
"testing",
"foo",
"",
"{{.Calibre}}.bar.example.com",
map[string]string{},
"{{.Name}}.bar.example.com",
map[string]string{},
[]string{"1.2.3.4"},
[]*endpoint.Endpoint{},
true,
map[string]string{
hostnameAnnotationKey: "foo.example.org.",
},
[]string{"1.2.3.4", "elb.com"},
[]*endpoint.Endpoint{
{DNSName: "foo.example.org", Target: "1.2.3.4"},
{DNSName: "foo.example.org", Target: "elb.com"},
},
false,
},
{
"compatibility annotated services with tmpl. compatibility takes precedence",
Expand All @@ -373,6 +378,19 @@ func testServiceSourceEndpoints(t *testing.T) {
},
false,
},
{
"not annotated services with unknown tmpl field should not return anything",
"",
"testing",
"foo",
"",
"{{.Calibre}}.bar.example.com",
map[string]string{},
map[string]string{},
[]string{"1.2.3.4"},
[]*endpoint.Endpoint{},
true,
},
} {
t.Run(tc.title, func(t *testing.T) {
// Create a Kubernetes testing client
Expand Down

0 comments on commit 4d48cef

Please sign in to comment.