From a92c22006bcfa140c1380579fcf48e350712fc59 Mon Sep 17 00:00:00 2001 From: fscnick Date: Tue, 7 Jan 2025 21:06:30 +0800 Subject: [PATCH] [Chore] make err as local variable in if-statement Signed-off-by: fscnick --- ray-operator/controllers/ray/raycluster_controller.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ray-operator/controllers/ray/raycluster_controller.go b/ray-operator/controllers/ray/raycluster_controller.go index 421a5fbda5..fa008b848f 100644 --- a/ray-operator/controllers/ray/raycluster_controller.go +++ b/ray-operator/controllers/ray/raycluster_controller.go @@ -501,8 +501,7 @@ func (r *RayClusterReconciler) reconcileRouteOpenShift(ctx context.Context, inst return err } - err = r.createHeadRoute(ctx, route, instance) - if err != nil { + if err := r.createHeadRoute(ctx, route, instance); err != nil { return err } } @@ -533,8 +532,7 @@ func (r *RayClusterReconciler) reconcileIngressKubernetes(ctx context.Context, i return err } - err = r.createHeadIngress(ctx, ingress, instance) - if err != nil { + if err := r.createHeadIngress(ctx, ingress, instance); err != nil { return err } }