client-go/rest: finish conversion to contextual logging

The remaining calls can be converted without API changes.

Kubernetes-commit: 7821abf2ae289673bbfa3b9a6b8b34f5196c7c7e
This commit is contained in:
Patrick Ohly
2024-09-02 17:55:12 +02:00
committed by Kubernetes Publisher
parent 7aa9904196
commit 5d128adc87
5 changed files with 49 additions and 36 deletions

View File

@@ -2476,6 +2476,7 @@ func TestRequestPreflightCheck(t *testing.T) {
}
func TestThrottledLogger(t *testing.T) {
logger := klog.Background()
now := time.Now()
oldClock := globalThrottledLogger.clock
defer func() {
@@ -2490,7 +2491,7 @@ func TestThrottledLogger(t *testing.T) {
wg.Add(10)
for j := 0; j < 10; j++ {
go func() {
if _, ok := globalThrottledLogger.attemptToLog(); ok {
if _, ok := globalThrottledLogger.attemptToLog(logger); ok {
logMessages++
}
wg.Done()
@@ -4175,6 +4176,7 @@ warnings.go] "Warning: warning 2" logger="TestLogger"
}
for name, tc := range testcases {
//nolint:logcheck // Intentionally testing with plain klog here.
t.Run(name, func(t *testing.T) {
state := klog.CaptureState()
defer state.Restore()