From b1d0d401875b2076e73183f8468ecb95c3fe61aa Mon Sep 17 00:00:00 2001 From: Ivan Sim Date: Thu, 15 Apr 2021 15:26:57 -0700 Subject: [PATCH] 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 --- staging/src/k8s.io/client-go/rest/request.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/staging/src/k8s.io/client-go/rest/request.go b/staging/src/k8s.io/client-go/rest/request.go index 0ac0e8eab85..6f4c0b054af 100644 --- a/staging/src/k8s.io/client-go/rest/request.go +++ b/staging/src/k8s.io/client-go/rest/request.go @@ -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)