fix: use klog.Infof to properly format DebugError output in StandardErrorMessage

Signed-off-by: xigang <wangxigang2014@gmail.com>

Kubernetes-commit: 03b523ace7bcf4643da17c835b8545235cd524a0
This commit is contained in:
xigang 2026-04-20 17:54:44 +08:00 committed by Kubernetes Publisher
parent be1551afc8
commit 9372aa7db9

View file

@ -243,7 +243,8 @@ func statusCausesToAggrError(scs []metav1.StatusCause) utilerrors.Aggregate {
// commands.
func StandardErrorMessage(err error) (string, bool) {
if debugErr, ok := err.(debugError); ok {
klog.V(4).Info(debugErr.DebugError())
msg, args := debugErr.DebugError()
klog.V(4).Infof(msg, args...)
}
status, isStatus := err.(apierrors.APIStatus)
switch {