Skip to content

Commit c1424d9

Browse files
authored
Fix node controller panic (#48)
* fix: typo * fix: nil panic issue
1 parent d47b6c8 commit c1424d9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/controller/node_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ func (r *NodeReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.
108108
if err := controllerutil.SetControllerReference(node, gpuNode, r.Scheme); err != nil {
109109
return ctrl.Result{}, fmt.Errorf("failed to set controller reference: %w", err)
110110
}
111-
_, e := controllerutil.CreateOrUpdate(ctx, r.Client, gpuNode, nil)
111+
_, e := controllerutil.CreateOrUpdate(ctx, r.Client, gpuNode, func() error { return nil })
112112
if e != nil {
113113
return ctrl.Result{}, fmt.Errorf("failed to create or patch GPUNode: %w", e)
114114
}

0 commit comments

Comments
 (0)