From ac0c4be36ad8a308287e178f090c66cf15c64ecc Mon Sep 17 00:00:00 2001 From: Dave Salisbury Date: Sat, 2 Oct 2021 15:23:48 +1000 Subject: [PATCH] Update tests for ingress class filtering --- source/ingress_test.go | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/source/ingress_test.go b/source/ingress_test.go index 804f35fa9..9f1590a4c 100644 --- a/source/ingress_test.go +++ b/source/ingress_test.go @@ -1175,7 +1175,7 @@ func testIngressEndpoints(t *testing.T) { { title: "ingressClassName filtering", targetNamespace: "", - ingressClassNameFilter: []string{"public"}, + ingressClassNames: []string{"public", "dmz"}, ingressItems: []fakeIngress{ { name: "fake-public", @@ -1191,12 +1191,23 @@ func testIngressEndpoints(t *testing.T) { ips: []string{"2.3.4.5"}, ingressClassName: "internal", }, + { + name: "fake-dmz", + namespace: namespace, + tlsdnsnames: [][]string{{"dmz.example.org"}}, + ips: []string{"3.4.5.6"}, + ingressClassName: "dmz", + }, }, expected: []*endpoint.Endpoint{ { DNSName: "example.org", Targets: endpoint.Targets{"1.2.3.4"}, }, + { + DNSName: "dmz.example.org", + Targets: endpoint.Targets{"3.4.5.6"}, + }, }, }, } { @@ -1219,7 +1230,7 @@ func testIngressEndpoints(t *testing.T) { ti.ignoreHostnameAnnotation, ti.ignoreIngressTLSSpec, ti.ignoreIngressRulesSpec, - ti.ingressClassNameFilter, + ti.ingressClassNames, ) // Informer cache has all of the ingresses. Retrieve and validate their endpoints. res, err := source.Endpoints(context.Background())