Skip to content

Commit d712213

Browse files
committed
fix: initialize GPU variable in TensorFusionConnectionReconciler
1 parent f7b373d commit d712213

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

internal/controller/tensorfusionconnection_controller.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,10 @@ func (r *TensorFusionConnectionReconciler) Reconcile(ctx context.Context, req ct
117117
}
118118

119119
if gpu == nil && connection.Status.GPU != "" {
120+
gpu = &tfv1.GPU{}
120121
if err := r.Get(ctx, client.ObjectKey{Name: connection.Status.GPU}, gpu); err != nil {
121122
log.Error(err, "Failed to get GPU.", "gpu", connection.Status.GPU)
123+
gpu = nil
122124
}
123125
}
124126

@@ -216,8 +218,7 @@ func (r *TensorFusionConnectionReconciler) mustUpdateStatus(ctx context.Context,
216218
latestgpu := &tfv1.GPU{}
217219

218220
if err := r.Get(ctx, client.ObjectKey{
219-
Name: gpu.Name,
220-
Namespace: gpu.Namespace,
221+
Name: gpu.Name,
221222
}, latestgpu); err != nil {
222223
return err
223224
}

0 commit comments

Comments
 (0)