Skip to content

Commit

Permalink
Fix scope related reconciliation failures
Browse files Browse the repository at this point in the history
  • Loading branch information
Tharsanan1 committed Oct 21, 2024
1 parent 1245646 commit 3a65082
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions adapter/internal/operator/controllers/dp/api_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -1896,8 +1896,7 @@ func (apiReconciler *APIReconciler) getAPIsForScope(ctx context.Context, obj k8c
if err := apiReconciler.client.List(ctx, httpRouteList, &k8client.ListOptions{
FieldSelector: fields.OneTermEqualSelector(httprouteScopeIndex, utils.NamespacedName(scope).String()),
}); err != nil {
loggers.LoggerAPKOperator.ErrorC(logging.PrintError(logging.Error2625, logging.CRITICAL, "Unable to find associated HTTPRoutes: %s", utils.NamespacedName(scope).String()))
return []reconcile.Request{}
loggers.LoggerAPKOperator.Warn(logging.PrintError(logging.Error2625, logging.CRITICAL, "Unable to find associated HTTPRoutes: %s", utils.NamespacedName(scope).String()))
}

if len(httpRouteList.Items) == 0 {
Expand All @@ -1914,8 +1913,7 @@ func (apiReconciler *APIReconciler) getAPIsForScope(ctx context.Context, obj k8c
if err := apiReconciler.client.List(ctx, gqlRouteList, &k8client.ListOptions{
FieldSelector: fields.OneTermEqualSelector(gqlRouteScopeIndex, utils.NamespacedName(scope).String()),
}); err != nil {
loggers.LoggerAPKOperator.ErrorC(logging.PrintError(logging.Error2625, logging.CRITICAL, "Unable to find associated GQLRoute: %s", utils.NamespacedName(scope).String()))
return []reconcile.Request{}
loggers.LoggerAPKOperator.Warn(logging.PrintError(logging.Error2625, logging.CRITICAL, "Unable to find associated GQLRoute: %s", utils.NamespacedName(scope).String()))
}

if len(gqlRouteList.Items) == 0 {
Expand All @@ -1931,8 +1929,7 @@ func (apiReconciler *APIReconciler) getAPIsForScope(ctx context.Context, obj k8c
if err := apiReconciler.client.List(ctx, grpcRouteList, &k8client.ListOptions{
FieldSelector: fields.OneTermEqualSelector(grpcRouteScopeIndex, utils.NamespacedName(scope).String()),
}); err != nil {
loggers.LoggerAPKOperator.ErrorC(logging.PrintError(logging.Error2625, logging.CRITICAL, "Unable to find associated GRPCRoutes: %s", utils.NamespacedName(scope).String()))
return []reconcile.Request{}
loggers.LoggerAPKOperator.Warn(logging.PrintError(logging.Error2625, logging.CRITICAL, "Unable to find associated GRPCRoutes: %s", utils.NamespacedName(scope).String()))
}

if len(grpcRouteList.Items) == 0 {
Expand Down

0 comments on commit 3a65082

Please sign in to comment.