Skip to content

Commit 6b276e8

Browse files
authored
fix: ensure GPU is retrieved before starting worker job (#26)
1 parent 56cbff8 commit 6b276e8

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

internal/controller/tensorfusionconnection_controller.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,13 @@ func (r *TensorFusionConnectionReconciler) Reconcile(ctx context.Context, req ct
116116
}
117117
}
118118

119-
if connection.Status.Phase != tfv1.TensorFusionConnectionPending {
119+
if gpu == nil && connection.Status.GPU != "" {
120+
if err := r.Get(ctx, client.ObjectKey{Name: connection.Status.GPU}, gpu); err != nil {
121+
log.Error(err, "Failed to get GPU.", "gpu", connection.Status.GPU)
122+
}
123+
}
124+
125+
if connection.Status.Phase != tfv1.TensorFusionConnectionPending && gpu != nil {
120126
// Start worker job
121127
workerPod, err := r.tryStartWorker(ctx, gpu, connection, types.NamespacedName{Name: connection.Name, Namespace: connection.Namespace})
122128
if err != nil {

0 commit comments

Comments
 (0)