Skip to content

Commit 4ec9edb

Browse files
committed
Cleanup error messages
Signed-off-by: Manuel de Brito Fontes <[email protected]>
1 parent 751d36f commit 4ec9edb

File tree

1 file changed

+4
-3
lines changed
  • components/node-labeler/cmd

1 file changed

+4
-3
lines changed

components/node-labeler/cmd/run.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ func (r *PodReconciler) Reconcile(ctx context.Context, req reconcile.Request) (r
197197
return reconcile.Result{}, nil
198198
}
199199

200-
log.WithError(err).Error("unexpected error removing node label")
200+
log.WithError(err).Error("removing node label")
201201
return reconcile.Result{RequeueAfter: time.Second * 10}, err
202202
}
203203

@@ -228,6 +228,7 @@ func (r *PodReconciler) Reconcile(ctx context.Context, req reconcile.Request) (r
228228
if component == registryFacade {
229229
err = checkRegistryFacade(ipAddress, port)
230230
if err != nil {
231+
log.WithError(err).Error("checking registry-facade: %v", err)
231232
return reconcile.Result{RequeueAfter: time.Second * 10}, nil
232233
}
233234
}
@@ -236,7 +237,7 @@ func (r *PodReconciler) Reconcile(ctx context.Context, req reconcile.Request) (r
236237

237238
err = updateLabel(labelToUpdate, true, nodeName, r)
238239
if err != nil {
239-
return reconcile.Result{}, fmt.Errorf("Unexpected error while trying to add the label: %v", err)
240+
return reconcile.Result{}, fmt.Errorf("trying to add the label: %v", err)
240241
}
241242

242243
readyIn := time.Since(pod.Status.StartTime.Time)
@@ -319,7 +320,7 @@ func checkRegistryFacade(host, port string) error {
319320
dummyURL := fmt.Sprintf("https://%v:%v/v2/remote/not-a-valid-image/manifests/latest", host, port)
320321
req, err := http.NewRequest(http.MethodGet, dummyURL, nil)
321322
if err != nil {
322-
return fmt.Errorf("unexpected error building HTTP request: %v", err)
323+
return fmt.Errorf("building HTTP request: %v", err)
323324
}
324325

325326
req.Header.Set("Accept", "application/vnd.oci.image.manifest.v1+json, application/vnd.oci.image.index.v1+json")

0 commit comments

Comments
 (0)