Fix the missing format specifier error in log output

The message argument is mistakenly used as the format specifier, if it
contains the special '%' characters. This causes many '[%d|%s](MISSING)'
errors in the API server logs.

Signed-off-by: Ivan Sim <isim@redhat.com>
This commit is contained in:
Ivan Sim 2021-04-15 15:26:57 -07:00
parent 74497632f4
commit b1d0d40187
No known key found for this signature in database
GPG Key ID: 40C65865B11F1502

View File

@ -602,7 +602,7 @@ func (r *Request) tryThrottleWithInfo(ctx context.Context, retryInfo string) err
if latency > extraLongThrottleLatency {
// If the rate limiter latency is very high, the log message should be printed at a higher log level,
// but we use a throttled logger to prevent spamming.
globalThrottledLogger.Infof(message)
globalThrottledLogger.Infof("%s", message)
}
metrics.RateLimiterLatency.Observe(ctx, r.verb, r.finalURLTemplate(), latency)