Skip to content

Commit 8c1bba5

Browse files
committed
fix
1 parent 587e8d0 commit 8c1bba5

3 files changed

Lines changed: 6 additions & 11 deletions

File tree

internal/controller/httproute_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ func (r *HTTPRouteReconciler) Reconcile(ctx context.Context, req ctrl.Request) (
155155
if err := r.Get(ctx, req.NamespacedName, hr); err != nil {
156156
if client.IgnoreNotFound(err) == nil {
157157
if err := r.updateHTTPRoutePolicyStatusOnDeleting(ctx, req.NamespacedName); err != nil {
158-
return ctrl.Result{}, err
158+
r.Log.Error(err, "failed to update HTTPRoutePolicy status on HTTPRoute deleting", "httproute", req.NamespacedName)
159159
}
160160
hr.Namespace = req.Namespace
161161
hr.Name = req.Name

internal/controller/httproutepolicy.go

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ func (r *HTTPRouteReconciler) processHTTPRoutePolicies(tctx *provider.TranslateC
4545
key = indexer.GenIndexKeyWithGK(gatewayv1.GroupName, internaltypes.KindHTTPRoute, httpRoute.GetNamespace(), httpRoute.GetName())
4646
)
4747
if err := r.List(context.Background(), &list, client.MatchingFields{indexer.PolicyTargetRefs: key}); err != nil {
48-
r.Log.Error(err, "failed to list HTTPRoutePolicies for HTTPRoute", "httproute", utils.NamespacedName(httpRoute))
49-
return nil
48+
return err
5049
}
5150

5251
if len(list.Items) == 0 {
@@ -110,8 +109,7 @@ func (r *HTTPRouteReconciler) updateHTTPRoutePolicyStatusOnDeleting(ctx context.
110109
key = indexer.GenIndexKeyWithGK(gatewayv1.GroupName, internaltypes.KindHTTPRoute, nn.Namespace, nn.Name)
111110
)
112111
if err := r.List(ctx, &list, client.MatchingFields{indexer.PolicyTargetRefs: key}); err != nil {
113-
r.Log.Error(err, "failed to list HTTPRoutePolicies for HTTPRoute", "httproute", nn)
114-
return nil
112+
return err
115113
}
116114
var (
117115
httpRoutes = make(map[types.NamespacedName]gatewayv1.HTTPRoute)
@@ -143,8 +141,7 @@ func (r *IngressReconciler) processHTTPRoutePolicies(tctx *provider.TranslateCon
143141
key = indexer.GenIndexKeyWithGK(networkingv1.GroupName, internaltypes.KindIngress, ingress.GetNamespace(), ingress.GetName())
144142
)
145143
if err := r.List(context.Background(), &list, client.MatchingFields{indexer.PolicyTargetRefs: key}); err != nil {
146-
r.Log.Error(err, "failed to list HTTPRoutePolicies for Ingress", "ingress", utils.NamespacedName(ingress))
147-
return nil
144+
return err
148145
}
149146

150147
if len(list.Items) == 0 {
@@ -186,8 +183,7 @@ func (r *IngressReconciler) updateHTTPRoutePolicyStatusOnDeleting(ctx context.Co
186183
key = indexer.GenIndexKeyWithGK(networkingv1.GroupName, internaltypes.KindIngress, nn.Namespace, nn.Name)
187184
)
188185
if err := r.List(ctx, &list, client.MatchingFields{indexer.PolicyTargetRefs: key}); err != nil {
189-
r.Log.Error(err, "failed to list HTTPRoutePolicies for Ingress", "ingress", nn)
190-
return nil
186+
return err
191187
}
192188
var (
193189
ingress2ParentRef = make(map[types.NamespacedName]gatewayv1.ParentReference)

internal/controller/ingress_controller.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ func (r *IngressReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ct
143143
if err := r.Get(ctx, req.NamespacedName, ingress); err != nil {
144144
if client.IgnoreNotFound(err) == nil {
145145
if err := r.updateHTTPRoutePolicyStatusOnDeleting(ctx, req.NamespacedName); err != nil {
146-
return ctrl.Result{}, err
146+
r.Log.Error(err, "failed to update HTTPRoutePolicy status on Ingress deleting", "ingress", req.NamespacedName)
147147
}
148148

149149
// Ingress was deleted, clean up corresponding resources
@@ -212,7 +212,6 @@ func (r *IngressReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ct
212212
// process HTTPRoutePolicy
213213
if err := r.processHTTPRoutePolicies(tctx, ingress); err != nil {
214214
r.Log.Error(err, "failed to process HTTPRoutePolicy", "ingress", ingress.Name)
215-
return ctrl.Result{}, err
216215
}
217216

218217
ProcessBackendTrafficPolicy(r.Client, r.Log, tctx)

0 commit comments

Comments
 (0)