Skip to content

Commit e8e905e

Browse files
committed
Remove usage of %w formatter from non ErrorF call
1 parent 598c51c commit e8e905e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/rotation/reconciler.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -405,9 +405,9 @@ func (r *Reconciler) reconcile(ctx context.Context, spcps *secretsstorev1.Secret
405405
gid, err = strconv.ParseInt(spcps.Status.FSGroup, 10, 64)
406406
if err != nil {
407407
errorReason = internalerrors.FailedToParseFSGroup
408-
errStr := fmt.Sprintf("failed to rotate objects for pod %s/%s, invalid FSGroup:%s, err: %w ", spcps.Namespace, spcps.Status.PodName, spcps.Status.FSGroup, err)
409-
r.generateEvent(pod, corev1.EventTypeWarning, mountRotationFailedReason, errStr)
410-
return fmt.Errorf("%s", errStr)
408+
errStr := fmt.Sprintf("failed to rotate objects for pod %s/%s, invalid FSGroup:%s", spcps.Namespace, spcps.Status.PodName, spcps.Status.FSGroup)
409+
r.generateEvent(pod, corev1.EventTypeWarning, mountRotationFailedReason, fmt.Sprintf("%s, err: %v", errStr, err))
410+
return fmt.Errorf("%s, err: %w", errStr, err)
411411
}
412412
}
413413
klog.V(5).InfoS("updating the secret content", "pod", klog.ObjectRef{Namespace: spcps.Namespace, Name: spcps.Status.PodName}, "FSGroup", gid)

0 commit comments

Comments
 (0)