diff --git a/source/ingress_test.go b/source/ingress_test.go index 9cf60d963..f79a7b222 100644 --- a/source/ingress_test.go +++ b/source/ingress_test.go @@ -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)