Skip to content

Commit

Permalink
Merge pull request #2609 from Tharsanan1/scope-fix
Browse files Browse the repository at this point in the history
Fix scope related reconciliation failures
  • Loading branch information
Krishanx92 authored Dec 10, 2024
2 parents 3d90e43 + 3a65082 commit da562da
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 da562da

Please sign in to comment.