@@ -321,8 +321,10 @@ func (r *AuthenticationReconciler) reconcileRoute(authCR *operatorv1alpha1.Authe
321
321
reqLogger .Info ("Reconciling route" , "annotations" , fields .Annotations , "routeHost" , fields .RouteHost , "routePath" , fields .RoutePath )
322
322
323
323
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
+ }
326
328
}
327
329
328
330
return r .ensureRouteExists (fCtx , authCR , fields )
@@ -331,10 +333,6 @@ func (r *AuthenticationReconciler) reconcileRoute(authCR *operatorv1alpha1.Authe
331
333
332
334
func (r * AuthenticationReconciler ) ensureRouteDoesNotExist (ctx context.Context , authCR * operatorv1alpha1.Authentication , fields * reconcileRouteFields ) (result * ctrl.Result , err error ) {
333
335
reqLogger := logf .FromContext (ctx )
334
- if fields .Name == IMCrtAuthRouteName {
335
- //do not delete certAuth route
336
- return subreconciler .ContinueReconciling ()
337
- }
338
336
reqLogger .Info ("Determined Route should not exist; removing if present" )
339
337
observedRoute := & routev1.Route {}
340
338
err = r .Get (ctx , types.NamespacedName {Name : fields .Name , Namespace : authCR .Namespace }, observedRoute )
0 commit comments