From 2ebe7742e43ee7e2adf2c8d15ba5cee56c42a57b Mon Sep 17 00:00:00 2001 From: Maskym Vavilov Date: Mon, 18 Sep 2023 13:10:13 +0100 Subject: [PATCH] adressing comments p4 --- pkg/controllers/dnspolicy/dnspolicy_dnsrecords.go | 2 +- test/integration/dnspolicy_controller_test.go | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/pkg/controllers/dnspolicy/dnspolicy_dnsrecords.go b/pkg/controllers/dnspolicy/dnspolicy_dnsrecords.go index 8591d4654..40297c98a 100644 --- a/pkg/controllers/dnspolicy/dnspolicy_dnsrecords.go +++ b/pkg/controllers/dnspolicy/dnspolicy_dnsrecords.go @@ -201,7 +201,7 @@ func listenerTotalAttachedRoutes(upstreamGateway *gatewayv1beta1.Gateway, downst if !found { return 0 } - if clusterName == downstreamCluster && (listenerName == string(specListener.Name) || strings.Contains(string(*specListener.Hostname), "*")) { + if clusterName == downstreamCluster && listenerName == string(specListener.Name) { return int(statusListener.AttachedRoutes) } } diff --git a/test/integration/dnspolicy_controller_test.go b/test/integration/dnspolicy_controller_test.go index 6265e398f..638062828 100644 --- a/test/integration/dnspolicy_controller_test.go +++ b/test/integration/dnspolicy_controller_test.go @@ -255,7 +255,14 @@ var _ = Describe("DNSPolicy", Ordered, func() { return err } gateway.Status.Addresses = testBuildGatewayAddresses() - gateway.Status.Listeners = testBuildGatewayListenerStatus([]string{TestPlacedClusterControlName + "." + TestAttachedRouteName, TestPlaceClusterWorkloadName + "." + TestAttachedRouteName}, []int32{1, 1}) + gateway.Status.Listeners = testBuildGatewayListenerStatus( + []string{ + TestPlacedClusterControlName + "." + TestAttachedRouteName, + TestPlaceClusterWorkloadName + "." + TestAttachedRouteName, + TestPlacedClusterControlName + "." + TestWildCardListenerName, + TestPlaceClusterWorkloadName + "." + TestWildCardListenerName, + }, + []int32{1, 1, 1, 1}) return k8sClient.Status().Update(ctx, gateway) }, TestTimeoutMedium, TestRetryIntervalMedium).ShouldNot(HaveOccurred()) // end of the workaround })