mirror of
https://github.com/kubernetes-sigs/external-dns.git
synced 2026-05-05 14:46:10 +02:00
ingress source: fix broken NewIngressSource test
and add an extra one for the mutual exclusivity of ingressClassNames and ingress.class annotationFilters
This commit is contained in:
parent
6c4a450b25
commit
31bc5bb077
@ -100,6 +100,7 @@ func TestNewIngressSource(t *testing.T) {
|
||||
fqdnTemplate string
|
||||
combineFQDNAndAnnotation bool
|
||||
expectError bool
|
||||
ingressClassNames []string
|
||||
}{
|
||||
{
|
||||
title: "invalid template",
|
||||
@ -131,6 +132,17 @@ func TestNewIngressSource(t *testing.T) {
|
||||
expectError: false,
|
||||
annotationFilter: "kubernetes.io/ingress.class=nginx",
|
||||
},
|
||||
{
|
||||
title: "non-empty ingress class name list",
|
||||
expectError: false,
|
||||
ingressClassNames: []string{"internal", "external"},
|
||||
},
|
||||
{
|
||||
title: "ingress class name and annotation filter jointly specified",
|
||||
expectError: true,
|
||||
ingressClassNames: []string{"internal", "external"},
|
||||
annotationFilter: "kubernetes.io/ingress.class=nginx",
|
||||
},
|
||||
} {
|
||||
ti := ti
|
||||
t.Run(ti.title, func(t *testing.T) {
|
||||
@ -145,7 +157,7 @@ func TestNewIngressSource(t *testing.T) {
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
[]string{},
|
||||
ti.ingressClassNames,
|
||||
)
|
||||
if ti.expectError {
|
||||
assert.Error(t, err)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user