@@ -146,7 +146,7 @@ func (r *LightrunJavaAgentReconciler) reconcileDeployment(ctx context.Context, l
146146 if err != nil {
147147 return r .errorStatus (ctx , lightrunJavaAgent , err )
148148 }
149- return r .errorStatus (ctx , lightrunJavaAgent , errors .New ("deployment not found" ))
149+ return r .errorStatus (ctx , lightrunJavaAgent , errors .New ("deployment not found: " + deploymentName ))
150150 } else {
151151 log .Error (err , "unable to fetch deployment" )
152152 return r .errorStatus (ctx , lightrunJavaAgent , err )
@@ -155,7 +155,7 @@ func (r *LightrunJavaAgentReconciler) reconcileDeployment(ctx context.Context, l
155155
156156 if oldLrjaName , ok := originalDeployment .Annotations [annotationAgentName ]; ok && oldLrjaName != lightrunJavaAgent .Name {
157157 log .Error (err , "Deployment already patched by LightrunJavaAgent" , "Existing LightrunJavaAgent" , oldLrjaName )
158- return r .errorStatus (ctx , lightrunJavaAgent , errors .New ("deployment already patched" ))
158+ return r .errorStatus (ctx , lightrunJavaAgent , errors .New ("deployment already patched: " + deploymentName ))
159159 }
160160
161161 deploymentApplyConfig , err := appsv1ac .ExtractDeployment (originalDeployment , fieldManager )
@@ -377,7 +377,7 @@ func (r *LightrunJavaAgentReconciler) reconcileStatefulSet(ctx context.Context,
377377 if err != nil {
378378 return r .errorStatus (ctx , lightrunJavaAgent , err )
379379 }
380- return r .errorStatus (ctx , lightrunJavaAgent , errors .New ("statefulset not found" ))
380+ return r .errorStatus (ctx , lightrunJavaAgent , errors .New ("statefulset not found: " + statefulSetName ))
381381 } else {
382382 log .Error (err , "unable to fetch statefulset" )
383383 return r .errorStatus (ctx , lightrunJavaAgent , err )
@@ -466,7 +466,7 @@ func (r *LightrunJavaAgentReconciler) reconcileStatefulSet(ctx context.Context,
466466 // Check if already patched by another LightrunJavaAgent
467467 if oldLrjaName , ok := originalStatefulSet .Annotations [annotationAgentName ]; ok && oldLrjaName != lightrunJavaAgent .Name {
468468 log .Error (err , "StatefulSet already patched by LightrunJavaAgent" , "Existing LightrunJavaAgent" , oldLrjaName )
469- return r .errorStatus (ctx , lightrunJavaAgent , errors .New ("statefulset already patched" ))
469+ return r .errorStatus (ctx , lightrunJavaAgent , errors .New ("statefulset :" + statefulSetName + " already patched" ))
470470 }
471471
472472 // Add finalizer if not already present
0 commit comments