Skip to content
This repository has been archived by the owner on Dec 16, 2024. It is now read-only.

Commit

Permalink
adressing comments p4
Browse files Browse the repository at this point in the history
  • Loading branch information
maksymvavilov committed Sep 25, 2023
1 parent 81472c7 commit 6db672f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pkg/controllers/dnspolicy/dnspolicy_dnsrecords.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down
16 changes: 12 additions & 4 deletions test/integration/dnspolicy_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
})
Expand Down Expand Up @@ -1212,9 +1219,10 @@ var _ = Describe("DNSPolicy", Ordered, func() {
Protocol: gatewayv1beta1.HTTPProtocolType,
}

Eventually(func() error {gateway.Spec.Listeners = append(gateway.Spec.Listeners, otherListener)
return k8sClient.Update(ctx, gateway)
}).Should(BeNil())
Eventually(func() error {
gateway.Spec.Listeners = append(gateway.Spec.Listeners, otherListener)
return k8sClient.Update(ctx, gateway)
}).Should(BeNil())

probeList := &v1alpha1.DNSHealthCheckProbeList{}
Eventually(func() error {
Expand Down

0 comments on commit 6db672f

Please sign in to comment.