Skip to content

Commit 859a5e0

Browse files
committed
address review comments
Signed-off-by: Rahul Sharma <[email protected]>
1 parent 0e2492a commit 859a5e0

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

controllers/nvidiadriver_controller.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,18 +100,18 @@ func (r *NVIDIADriverReconciler) Reconcile(ctx context.Context, req ctrl.Request
100100
// Get the singleton NVIDIA ClusterPolicy object in the cluster.
101101
clusterPolicyList := &gpuv1.ClusterPolicyList{}
102102
if err := r.List(ctx, clusterPolicyList); err != nil {
103-
err = fmt.Errorf("error getting ClusterPolicy list: %w", err)
103+
wrappedErr := fmt.Errorf("error getting ClusterPolicy list: %w", err)
104104
logger.Error(err, "error getting ClusterPolicy list")
105105
instance.Status.State = nvidiav1alpha1.NotReady
106106
if condErr := r.conditionUpdater.SetConditionsError(ctx, instance, conditions.ReconcileFailed, err.Error()); condErr != nil {
107107
logger.Error(condErr, "failed to set condition")
108108
}
109-
return reconcile.Result{}, err
109+
return reconcile.Result{}, wrappedErr
110110
}
111111

112112
if len(clusterPolicyList.Items) == 0 {
113113
err := fmt.Errorf("no ClusterPolicy object found in the cluster")
114-
logger.Error(err, "no ClusterPolicy object found in the cluster")
114+
logger.Error(err, "failed to get ClusterPolicy object")
115115
instance.Status.State = nvidiav1alpha1.NotReady
116116
if condErr := r.conditionUpdater.SetConditionsError(ctx, instance, conditions.ReconcileFailed, err.Error()); condErr != nil {
117117
logger.Error(condErr, "failed to set condition")

controllers/upgrade_controller.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,7 @@ func (r *UpgradeReconciler) removeNodeUpgradeStateLabels(ctx context.Context) er
218218
delete(node.Labels, upgradeStateLabel)
219219
err = r.Update(ctx, node)
220220
if err != nil {
221-
r.Log.Error(
222-
err, "Failed to reset upgrade state label from node", "node", node)
221+
r.Log.Error(err, "Failed to reset upgrade state label from node", "node", node)
223222
return err
224223
}
225224
}

0 commit comments

Comments
 (0)