-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
elliminate premature termination of DNS controller logic #655
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #655 +/- ##
==========================================
+ Coverage 80.20% 82.81% +2.60%
==========================================
Files 64 72 +8
Lines 4492 5416 +924
==========================================
+ Hits 3603 4485 +882
- Misses 600 626 +26
- Partials 289 305 +16
Flags with carried forward coverage won't be shown. Click here to find out more.
|
For verification you could use this branch and run |
It seems fairly straightforward to force this error so not sure why we can't ensure we have it covered in our tests. It doesn't have to be an explicit test case if that is what you are concerned about, you can update the existing ones to include another listener with a status that has 0 AttachedRoutes. gateway = NewGatewayBuilder(TestGatewayName, gatewayClass.Name, testNamespace).
WithHTTPListener("foo", "foo.example.com"). //<-- Listener with no attached routes
WithHTTPListener(TestListenerNameOne, TestHostOne).
WithHTTPListener(TestListenerNameWildcard, TestHostWildcard).
Gateway
Expect(k8sClient.Create(ctx, gateway)).To(Succeed())
clusterHash = common.ToBase36HashLen(clusterUID, utils.ClusterIDLength)
ownerID = common.ToBase36HashLen(fmt.Sprintf("%s-%s-%s", clusterUID, gateway.Name, gateway.Namespace), utils.ClusterIDLength)
gwHash = common.ToBase36HashLen(gateway.Name+"-"+gateway.Namespace, 6)
//Set single cluster gateway status
Eventually(func() error {
gateway.Status.Addresses = []gatewayapiv1.GatewayStatusAddress{
{
Type: ptr.To(gatewayapiv1.IPAddressType),
Value: TestIPAddressOne,
},
{
Type: ptr.To(gatewayapiv1.IPAddressType),
Value: TestIPAddressTwo,
},
}
gateway.Status.Listeners = []gatewayapiv1.ListenerStatus{
{
Name: "foo",
SupportedKinds: []gatewayapiv1.RouteGroupKind{},
AttachedRoutes: 0,
Conditions: []metav1.Condition{},
},
{
Name: TestListenerNameOne,
SupportedKinds: []gatewayapiv1.RouteGroupKind{},
AttachedRoutes: 1,
Conditions: []metav1.Condition{},
},
{
Name: TestListenerNameWildcard,
SupportedKinds: []gatewayapiv1.RouteGroupKind{},
AttachedRoutes: 1,
Conditions: []metav1.Condition{},
},
}
return k8sClient.Status().Update(ctx, gateway)
}, TestTimeoutMedium, TestRetryIntervalMedium).Should(Succeed()) This will fail without the fix. |
I was mostly thinking about explicitly testing for it, but this could work as well, i guess 🤔 added |
Build Images job is failing due to this #580. We can ignore it on this PR. |
beaffed
to
0a7ec17
Compare
What
If we specify the first listener in the GW spec to be the one without attached routes we never get to the second and never create DNS records for it (even if there are attached routes). This PR fixes it.
I'm not including integration test for this case - the suite has over 150 cases now and I do not consider this scenario to be critical for testing on each pull request