@@ -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" )
0 commit comments