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 Oct 3, 2023
1 parent 969825d commit cb0ac5d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 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
14 changes: 11 additions & 3 deletions test/integration/dnspolicy_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,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 @@ -1276,8 +1283,9 @@ var _ = Describe("DNSPolicy", Ordered, func() {
Protocol: gatewayv1beta1.HTTPProtocolType,
}

patch = client.MergeFrom(gateway.DeepCopy())gateway.Spec.Listeners = append(gateway.Spec.Listeners, otherListener)
Expect(k8sClient.Patch(ctx, gateway, patch)).To(BeNil())
patch = client.MergeFrom(gateway.DeepCopy())
gateway.Spec.Listeners = append(gateway.Spec.Listeners, otherListener)
Expect(k8sClient.Patch(ctx, gateway, patch)).To(BeNil())

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

0 comments on commit cb0ac5d

Please sign in to comment.