Skip to content

Commit 5df860f

Browse files
ujjwalchk-itUjjwal Chakraborty
andauthored
Handling passthrough route zenfrontdoor (#1012)
* handling passthrough route zenfrontdoor * handling passthrough route zenfrontdoor Signed-off-by: Ujjwal Chakraborty <[email protected]> * handling passthrough route zenfrontdoor Signed-off-by: Ujjwal Chakraborty <[email protected]> * handling passthrough route zenfrontdoor Signed-off-by: Ujjwal Chakraborty <[email protected]> --------- Signed-off-by: Ujjwal Chakraborty <[email protected]> Co-authored-by: Ujjwal Chakraborty <[email protected]>
1 parent e9440c5 commit 5df860f

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

controllers/operator/routes.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,10 @@ func (r *AuthenticationReconciler) reconcileRoute(authCR *operatorv1alpha1.Authe
321321
reqLogger.Info("Reconciling route", "annotations", fields.Annotations, "routeHost", fields.RouteHost, "routePath", fields.RoutePath)
322322

323323
fCtx := logf.IntoContext(ctx, reqLogger)
324-
if shouldNotHaveRoutes(authCR, &r.DiscoveryClient) {
325-
return r.ensureRouteDoesNotExist(fCtx, authCR, fields)
324+
if fields.Name != IMCrtAuthRouteName {
325+
if shouldNotHaveRoutes(authCR, &r.DiscoveryClient) {
326+
return r.ensureRouteDoesNotExist(fCtx, authCR, fields)
327+
}
326328
}
327329

328330
return r.ensureRouteExists(fCtx, authCR, fields)
@@ -331,10 +333,6 @@ func (r *AuthenticationReconciler) reconcileRoute(authCR *operatorv1alpha1.Authe
331333

332334
func (r *AuthenticationReconciler) ensureRouteDoesNotExist(ctx context.Context, authCR *operatorv1alpha1.Authentication, fields *reconcileRouteFields) (result *ctrl.Result, err error) {
333335
reqLogger := logf.FromContext(ctx)
334-
if fields.Name == IMCrtAuthRouteName {
335-
//do not delete certAuth route
336-
return subreconciler.ContinueReconciling()
337-
}
338336
reqLogger.Info("Determined Route should not exist; removing if present")
339337
observedRoute := &routev1.Route{}
340338
err = r.Get(ctx, types.NamespacedName{Name: fields.Name, Namespace: authCR.Namespace}, observedRoute)

controllers/operator/routes_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,8 @@ var _ = Describe("Route handling", func() {
858858
}
859859
err = r.List(ctx, routes, listOpts...)
860860
Expect(err).ToNot(HaveOccurred())
861-
Expect(routes.Items).To(HaveLen(0))
861+
Expect(routes.Items).To(HaveLen(1))
862+
Expect(routes.Items[0].Name).To(Equal(IMCrtAuthRouteName))
862863
})
863864

864865
It("updates all Routes when differences are found and requeues", func() {

0 commit comments

Comments
 (0)